AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.68k stars 7.96k forks source link

Less detections after training with yolov4-tiny-3l.cfg than with yolov4-tiny.cfg #7676

Open ToshiEAB opened 3 years ago

ToshiEAB commented 3 years ago

Hello,

I am comparing the results after training with yolov4-tiny-3l.cfg (3 yolo layers) than with yolov4-tiny.cfg (2 yolo layers). I was expecting to see more detections for with yolov4-tiny-3l.cfg after reading the "How to improve object detection" section but actually see a lot less detections. The yolov4-tiny-3l.cfg has width=608 and height=608 whereas yolov4-tiny.cfg has width=416 and height=416. Another difference was that, before training, I set random=1 in yolov4-tiny-3l.cfg whereas I set random=0 in yolov4-tiny.cfg in each yolo layer. After training, mAP was higher for yolov4-tiny-3l.cfg (65% for 1 class) than for yolov4-tiny.cfg (50% for 1 class).

I'm using the same set of annotated images (MS COCO) for the comparison, the same platform (Windows 10 64bit, CPU). and the same programming language (Python).

In my Python program (with OpenCV 4.5.1), I write: blob = cv2.dnn.blobFromImage(img, 0.00392, (608, 608), (0, 0, 0), True, crop=False) # For yolov4-tiny-3l.cfg blob = cv2.dnn.blobFromImage(img, 0.00392, (416, 416), (0, 0, 0), True, crop=False) # For yolov4-tiny.cfg

Is there anything I'm missing?

Thanks in advance.

poornimajd commented 3 years ago

Did you get similar speeds or fps for both the models?

poornimajd commented 3 years ago

After training, mAP was higher for yolov4-tiny-3l.cfg (65% for 1 class) than for yolov4-tiny.cfg (50% for 1 class).

More detections may not always be correct,there might be false positives.The mAP figures indicate this point.

ToshiEAB commented 3 years ago

@poornimajd

Thanks for answering my question and sorry about the delay in replying.

Did you get similar speeds or fps for both the models? No, the speed was slower with yolov4-tiny-3l.cfg (3 yolo layers). I didn't measure FPS but I could tell just by looking.

More detections may not always be correct,there might be false positives.The mAP figures indicate this point. Actually, most detections were correct when using YOLO with a webcam regardless of the models. Just lots of false "negatives" with yolov4-tiny-3l.cfg (3 yolo layers).