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

Multiple bounding boxes for the same object #360

Closed OneManArmy93 closed 3 years ago

OneManArmy93 commented 3 years ago

Hello, after I converted my Yolov4 to tflite version using the command python convert_tflite.py --weights ./checkpoints/yolov4-608 --output ./checkpoints/yolov4-608-fp16.tflite --quantize_mode float16 and then running the script detect.py I get multiple bounding boxes for the same objet. Please note that I have a custom dataset and therefore converted the custom weights.

m-peker commented 3 years ago

Hi,

I also faced the same problem. Did you find a solution?

OneManArmy93 commented 3 years ago

@m-peker hello, after looking around in the code I managed to fix the multiple BB issue. in the script detect.py you just have to change the value of the iou to 0.1 or any other value (you just have to experiment): flags.DEFINE_float('iou', 0.45, 'iou threshold') by flags.DEFINE_float('iou', 0.1, 'iou threshold')

m-peker commented 3 years ago

Thank you. Now, there is only one detection for each object.

roderick1014 commented 2 years ago

Hi, is your output weight of training a ".data-00000-of-00001" & ".index" files? Then you transform them to ".pb" file and ".tflite" after that. @OneManArmy93