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.25k stars 1.24k forks source link

model detects a lot of object classes where there are none #456

Open Marianoxis opened 2 years ago

Marianoxis commented 2 years ago

Helo Bro! The yolov4.weights file in your github is down. I use the file from darknet (https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights), but the recognicion from the model detects a lot of object classes where there are none

Convert darknet weights to tensorflow

yolov4

python save_model.py --weights ./data/yolov4.weights --output ./checkpoints/yolov4-416 --input_size 416 --model yolov4

Run demo tensorflow

python detect.py --weights ./checkpoints/yolov4-416 --size 416 --model yolov4 --image ./data/kite.jpg

detection1

Mercurise commented 2 years ago

Hi @Marianoxis

I got the same mess detection issue yesterday. In my case, I used different cmd for model saving.

The issue is fixed by replacing --tiny False with --tiny=False. (the repo's demo cmd is correct).

For your case, I'd recommend to double check whether your saved model is valid w.r.t. number of layers, parameters, etc. It should have 110 conv2d layers and 602 layers in total.

Good luck