hunglc007 / tensorflow-yolov4-tflite

YOLOv4, YOLOv4-tiny, YOLOv3, YOLOv3-tiny Implemented in Tensorflow 2.0, Android. Convert YOLO v4 .weights tensorflow, tensorrt and tflite
https://github.com/hunglc007/tensorflow-yolov4-tflite
MIT License
2.23k stars 1.24k forks source link

detection problem after converting darknet to tensorflow #330

Closed bqdong closed 3 years ago

bqdong commented 3 years ago

Hi, I use darknet to train my custom dataset. Then I convert weight file to tensorflow. When I try to detect, I get different result comparing to use darknet. Here is darknet: image Tensorflow: image The boxes get bigger! When I convert, I only modify this line. Why?

Micky-123 commented 3 years ago

@bqdong : were you able to root cause the above issue?

bqdong commented 3 years ago

@Micky-123 No way

WenOOI commented 3 years ago

I met the same problem like yours. Have you solved it? I changed the 'width' and 'height' of 'cfg/yolov4-tiny-custom.cfg' from 416 to 320 in darknet, and then I correspondingly changed the size in 'save_modle.py' and 'detect.py' of Tensorflow. So I have made sure the size is the same. But the result shows the same problem presented above. Hope someone can answer my question. Thanks!

WenOOI commented 3 years ago

https://github.com/hunglc007/tensorflow-yolov4-tflite/issues/174#issuecomment-666055130 I solved my problem according to this answer.

bqdong commented 3 years ago

@WenOOI The way you find should work. I use opencv dnn module to read darknet directly and it works well. This is also a way to solve this problem.