Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any implementation for tiny yolov4 version? #16

Open
farhantandia opened this issue Jul 23, 2020 · 2 comments
Open

any implementation for tiny yolov4 version? #16

farhantandia opened this issue Jul 23, 2020 · 2 comments

Comments

@farhantandia
Copy link

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

@freitaucher
Copy link

freitaucher commented Aug 5, 2020

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants