AlexeyAB / darknet

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

Calculation mAP problem #2456

Open astronaut71 opened 5 years ago

astronaut71 commented 5 years ago

Hi I tried to calculation mAP (mean average precision). when run the training with ./darknet detector train /home/darknet/data/workers.data /home/darknet/cfg/yolo-obj.cfg darknet53.conv.74 -map

i got this error

calculation mAP (mean average precision)...
Cannot load image "/home/darknet/data/obj/test_imgs/20181210_112823.jpg"
STB Reason: can't fopen

Can't open label file. (This can be normal only if you use MSCOCO): /home/darknet/data/obj/test_imgs/20181210_112823.txt

What is the problem?

AlexeyAB commented 5 years ago

@astronaut71 Hi, It means that there is no such file /home/darknet/data/obj/test_imgs/20181210_112823.jpg Remove this path from your txt-file that is specified as valid= param in your obj.data file.

pkhigh commented 5 years ago

@AlexeyAB I want to check my detector accuracy on validation set.

This is a sample response i got :

calculation mAP (mean average precision)... 272 detections_count = 519, unique_truth_count = 272
class_id = 0, name = Phone, ap = 96.62 % for thresh = 0.90, precision = 1.00, recall = 0.74, F1-score = 0.85 for thresh = 0.90, TP = 202, FP = 0, FN = 70, average IoU = 88.66 %

IoU threshold = 50 % mean average precision (mAP@0.50) = 0.966198, or 96.62 %

Here, I know my detector is not very accurate. Is there a way to input different values for IoU thresholds using command line arguments? Like we can use '-thresh value' for different confidence thresholds. How do I give different threshold for (mAP@0.50) like (mAP@0.90) ?

pkhigh commented 5 years ago

i got it. '-iou_thresh' can be used.

buzdarbalooch commented 5 years ago

same question, does any one have a solution. @AlexeyAB .

buzdarbalooch commented 5 years ago

@AlexeyAB @pkhigh my question is how can we see how many objects are there for each consider i traied the network for three classes.

pshwetank commented 4 years ago

@buzdarbalooch You can write your own script for counting the no of images where the objects occur and then visualize the results. In case of Python, it can be a simple dictionary datatype mapping object class to the images where it occurs.