How to reach mAP, precision, recall metrics for each classes. (Model Garden)

Hello everyone,

I’m using tensorflow model garden for object detection.

I’m trying to modify object detection tutorial with different dataset and different model configurations.

In my dataset ı had 3 classes and I want to see mAP and other metrics class by class. Tensorboard gaved avarege mAP values for 3 classes.
Tutorial ı followed: Google Colab

Hi @Taha_Er,

you can configure the map for each class by setting the hyperparameter in the experiment configuration.

for example:

exp_config = exp_factory.get_exp_config('retinanet_resnetfpn_coco')
exp_config.task. per_category_metrics=True
1 Like

To see mAP and other metrics for each class using TensorFlow’s Model Garden for object detection, you’ll need to make some modifications:

  1. Check your config file: Ensure your evaluation configuration is set to compute the desired metrics.
  2. Modify the evaluation script: If the default script doesn’t provide class-specific metrics, you may need to adjust it to compute and log these metrics for each class.
  3. Customize metric computation: If necessary, customize the code to calculate precision, recall, and mAP for each class based on the model’s outputs.
  4. Log metrics to TensorBoard: Use TensorBoard to log and visualize these class-specific metrics during the evaluation phase.
  5. Run the evaluation: After making these changes, run the evaluation process and use TensorBoard to view the metrics per class.

This process might require some familiarity with TensorFlow and its Object Detection API to customize the scripts and configurations.

1 Like

Hello, @Siva_Sravana_Kumar_N @Tim_Wolfe
Thank you for your answer. I will try your solution as soon as possible and update the answer.