tensorflow-yolov4-tflite icon indicating copy to clipboard operation
tensorflow-yolov4-tflite copied to clipboard

model detects a lot of object classes where there are none

Open Marianoxis opened this issue 3 years ago • 1 comments

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

Marianoxis avatar Jul 05 '22 22:07 Marianoxis

Hi @Marianoxis

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

  • I added the extra --framework tf and --tiny False
  • For the weights, I also downloaded them from AB's repo and worked fine locally.

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

Mercurise avatar Aug 19 '22 10:08 Mercurise