Question mAP
Mirorrn opened this issue · 12 comments
Hi, thanks for posting your code :)
I have a question about mAP. I dont understand how to compute this metric.
I saw that you calc it but can´t find it in your code.
Thank you!
I have yet to commit the evaluation code. It's very messy now. But it's coming soon.
P/S: I modify the code from https://github.com/cocodataset/cocoapi/.
I have written my own code based on VOC evaluation. But i think my results are wrong. My mAP results for original tiny Yolo on VOC 2007 is 44 and not 57 :(
Maybe because i don't sort my results for highest confidenz score at first.
I am using this implementation for mAP https://github.com/MathGaron/mean_average_precision (at the moment is not interpolated and by default it computes the precision-recall curve in 11 points).
For simplicity, instead of using it as a Keras metric I use the predict
method to get predictions for some images and then update the mAP metric with evaluate
.
The structure is something like this:
yolo = YOLO(...) # Create model
yolo.load_weights(weights_path) # Load weights
mAP = DetectionMAP(num_classes) # Initialise metric
for image in images:
boxes = yolo.predict(image)
# prepare objects pred_bb, pred_classes, pred_conf, gt_bb and gt_classes
mAP.evaluate(pred_bb, pred_classes, pred_conf, gt_bb, gt_classes) # Update the metric
mAP.plot() # Get the value of the metric and precision-recall plot for each class
It seems it's working fine so it might be helpful for somebody.
BTW, @experiencor thanks for the Yolo implementation :)
Sir I have been trained it after 3 ephocs it gives me error as killed and loss not yet decreased.how would I fix these in code "after 3 ephocs it killed", but I want it doesn't kill after 3 ephocs.
I have yet to commit the evaluation code. It's very messy now. But it's coming soon.
P/S: I modify the code from https://github.com/cocodataset/cocoapi/.
Hi,
Did you commit the evaluation code?
I am using this implementation for mAP https://github.com/MathGaron/mean_average_precision (at the moment is not interpolated and by default it computes the precision-recall curve in 11 points).
For simplicity, instead of using it as a Keras metric I use thepredict
method to get predictions for some images and then update the mAP metric withevaluate
.
The structure is something like this:yolo = YOLO(...) # Create model yolo.load_weights(weights_path) # Load weights mAP = DetectionMAP(num_classes) # Initialise metric for image in images: boxes = yolo.predict(image) # prepare objects pred_bb, pred_classes, pred_conf, gt_bb and gt_classes mAP.evaluate(pred_bb, pred_classes, pred_conf, gt_bb, gt_classes) # Update the metric mAP.plot() # Get the value of the metric and precision-recall plot for each class
It seems it's working fine so it might be helpful for somebody.
BTW, @experiencor thanks for the Yolo implementation :)
@alessandro-montanari can you help me to calculate mAP using that repo? i do not understand it . Can you explain me which files i need to prepare to run? i have trained keras_yolo2 model using thsi repo. now i want to calculate mAP using this model. which other files i need and how to run the other repo for mAP? Can you provide your email address?
@mrannadinc yes that is normal! work with training parameters; learning rate etc.
Did anyone tried squeezenet? I trained squeezenet, the training went fine, in converged and loss dropped to 0.01, but when I trying to test it, nothing is detected. Did anyone experience this?
Q2: what would be the input size for squeezenet? 224 or 416 or sthing else?
--thankyou
Hello,
I trained yolov2 using all explanations with 12 classes but it is detecting only 8 classes but not all 12. Can anyone please help me with increasing the accuracy of the yolov2 model.
Hoping for the reply as soon as possible.
TIA