sovit-123 / fasterrcnn-pytorch-training-pipeline

PyTorch Faster R-CNN Object Detection on Custom Dataset
MIT License
223 stars 77 forks source link

calculate mAP for each class #80

Open samahwaleed opened 1 year ago

samahwaleed commented 1 year ago

Dear Sir,

currently, the code shows the overall mAP. Is it possible to add mAP for each class, please?

Regards,

sovit-123 commented 1 year ago

Hello. You can run eval.py after training the model using the best weights to show the mAP for each class. It is not shown during training as it takes longer to calculate the mAP for each class. You can use a command similar to the following by using your parameter: python eval.py --data data_configs/voc.yaml --weights outputs/training/project/best_model.pth --model fasterrcnn_mobilenetv3_large_fpn --verbose

The --verbose flag prints class-wise mAP.