experiencor / keras-yolo2

Easy training on custom dataset. Various backends (MobileNet and SqueezeNet) supported. A YOLO demo to detect raccoon run entirely in brower is accessible at https://git.io/vF7vI (not on Windows).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question mAP

Mirorrn opened this issue · 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.

Hi! sir nice contribute,

I have a question: ther train.py go 8 hours in maximun CVPU and memory, is it normal?

I wait your kind feedback.
Captura de pantalla de 2019-04-06 09-52-39

Captura de pantalla de 2019-04-06 02-13-51

is this normal? the training scale is 15 hours left and my 1 epoch is steel like this i cant understand why?
Ekran Görüntüsü (27)

somebody can help me?

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?

commented

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 :)

@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?

commented

@mrannadinc yes that is normal! work with training parameters; learning rate etc.

commented

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

commented