AlexeyAB / darknet

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

Very low loss but no detection on images #7307

Open Snickbrack opened 3 years ago

Snickbrack commented 3 years ago

read FAQ: https://github.com/AlexeyAB/darknet/wiki/FAQ---frequently-asked-questions

I have read the FAQ and

what command do you use?

detector train .\yolo.data .\yolov3_license_plate.cfg .\yolov3_license_plate_last.weights

what dataset do you use?

I use a custom dataset with german license plates. Examples can be found in the attachment.

what Loss and mAP did you get?

I do get a Loss of around 0.0034 and a mAP of (TP = 0, FP = 0) after 5k of Iterations

show chart.png with Loss and mAP

It is in the attachment

check your dataset - run training with flag -show_imgs i.e. ./darknet detector train ... -show_imgs and look at the aug_...jpg images, do you see correct truth bounded boxes?

I do see the correct bounding boxes

rename your cfg-file to txt-file and drag-n-drop (attach) to your message here

it is

show content of generated files bad.list and bad_label.list if they exist

There are no files.

Aug-Files: aug-images.zip

Config-File: yolov3_license_plate.txt

chart

PaserSRL commented 3 years ago

I have the same issue...

Snickbrack commented 3 years ago

I have changed the Network Size to 768x768 and the division to 64. And now I now get following output for mAP for around 3k Batches:

calculation mAP (mean average precision)...
Detection layer: 82 - type = 28
Detection layer: 94 - type = 28
Detection layer: 106 - type = 28
6300
detections_count = 7680, unique_truth_count = 9013
class_id = 0, name = license_plate, ap = 3.38%           (TP = 300, FP = 284)

for conf_thresh = 0.25, precision = 0.51, recall = 0.03, F1-score = 0.06
for conf_thresh = 0.25, TP = 300, FP = 284, FN = 8713, average IoU = 32.89 %

IoU threshold = 50 %, used Area-Under-Curve for each unique Recall
mean average precision (mAP@0.50) = 0.033779, or 3.38 %
Total Detection Time: 1231 Seconds.

And I also got some good detections for manual testing some of my images. I think darknet was not able to see the objects which I wanted to be detected. I will run the training to finish and share my results here.

versavel commented 3 years ago

TP = 0, FP = 0 indicates that none of the testing images have an object defined in their .txt annotation file. To fix this issue, did you change the valid = ... line in your .\yolo.data file to get the new TP = 300, FP = 284 result ?

Snickbrack commented 3 years ago

@versavel I do have annotations in the .txt Files of the Testing Images.

I use all of my training images as Validation Images. And no. The only thing I have changed was to increase the network Size and the subdivision-Parameter