LeonLok / Deep-SORT-YOLOv4

People detection and optional tracking with Tensorflow backend.
GNU General Public License v3.0
499 stars 170 forks source link

any implementation for tiny yolov4 version? #16

Open farhantandia opened 4 years ago

farhantandia commented 4 years ago

Fail to convert tiny version, any help for it? thanks

freitaucher commented 4 years ago

well, instead of modifying convert.py I tried to work out demo.py. There one should import:

from yolov4.tf import YOLOv4 # (this can be installed with pip)

and read in the weight of yolov4-tiny:

yolo = YOLOv4(tiny=True) yolo.classes = "model_data/coco_classes.txt" yolo.make_model() yolo.load_weights("model_data/yolov4-tiny.weights", weights_type="yolo")

So far so good, until I start with encoding:

from tools import generate_detections as gdet ... encoder = gdet.create_box_encoder("model_data/mars-small128.pb", batch_size=1) ... features = encoder(frame, boxes) ...

if one looks in the appropriate source: tools/generate_detections .py, there one finds

import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior()

and exactly this spoils in the main code everything which has to deal with tensorflow 2. In fact, it is needed only inside class ImageEncoder(object)

Would someone hint how to work out this encoder in tf2 (best), or how to limit the use of tf1 to the encoder module only, or at least explain - what is the purpose of encoder?

freitaucher commented 4 years ago

Ok, the purpose of encoder is now clear. It simplifies the input info for tracker. Anyway, the technical issue with tf2 remains..