Is it possible mAP accuracy detr during training?

Hello everyone,

I’m currently working on fine-tuning the DETR (DEtection TRansformer) model for object detection on a custom dataset. I have followed a tutorial on https://github.com/NielsRogge/Transformers-Tutorials/blob/master/DETR/Fine_tuning_DetrForObjectDetection_on_custom_dataset_(balloon).ipynbGitHub to guide me through the fine-tuning process. However, I encountered a challenge in monitoring the Mean Average Precision (mAP) accuracy of the model during training.

Has anyone successfully implemented mAP calculation during training with DETR? If so, could you please provide some guidance or suggestions on how to correctly integrate mAP calculation into the training loop of the DETR model?

Your help would be greatly appreciated. Thank you!

1 Like

Here you will find an implementation of mAP among other metrics. It’s quite a bit confusing with the different bbox formats. Here a summary for DETR’s:

  • model input: coco (x_min, y_min, w, h)
  • after image processor: yolo (x_center, y_center, w, h)
  • for the metrics part you are as well confronted with yolo
  • inference out: pascal_voc (x_min, y_min, x_max, y_max)

That means that you should transform the outputs to the appropriate format.

Here a overview to the different bboxes.

Happy coding :wink:

1 Like