yijingru / BBAVectors-Oriented-Object-Detection

[WACV2021] Oriented Object Detection in Aerial Images with Box Boundary-Aware Vectors
MIT License
469 stars 88 forks source link

How to print mAP or AP of each object category after Testing #93

Open MFalam opened 3 years ago

MFalam commented 3 years ago

Hello, I re-implemented BBAVectors-Oriented-Object-Detection and tested the result with the provided model weights on the DOTA. I have 2 questions:

  1. After running python main.py --data_dir dataPath --batch_size 16 --dataset dota --phase test on the terminal only avg time and FPS are displayed. How can I print the AP of each category or mAP of the categories on the terminal after testing.

  2. After running python main.py --data_dir dataPath --batch_size 16 --dataset dota --phase test the bounding boxes on the detected objects are all displayed with purple and have cross at the centre. Is there a way to show detected objects of different categories with different colour bunding boxes and remove the cross from the bounding boxes centre? I already tried to use dataset_dota.py , but could not handle it.

Thank you.

yijingru commented 3 years ago

You may want to look into (1) eval.py (mAP for dota is provided by the online server) (2) test.py

MFalam commented 3 years ago

You may want to look into (1) eval.py (mAP for dota is provided by the online server) (2) test.py

Dear @yijingru, Thanks for the prompt response. Please may you guide more specifically.

dineshdaultani commented 3 years ago

@MFalam, My best guess for (2) would be to update the below line in test.py ori_image = cv2.drawContours(ori_image, [np.int0(box)], -1, (255,0,255),1,1) here: https://github.com/yijingru/BBAVectors-Oriented-Object-Detection/blob/master/test.py#L167

All you need to do is update 4th parameter i.e. (255,0,255) to other RGB values. You can have a dictionary where you can have different colors for each category mapped here.

Reference: https://docs.opencv.org/4.5.2/d6/d6e/group__imgproc__draw.html#ga746c0625f1781f1ffc9056259103edbc

MFalam commented 3 years ago

@MFalam, My best guess for (2) would be to update the below line in test.py ori_image = cv2.drawContours(ori_image, [np.int0(box)], -1, (255,0,255),1,1) here: https://github.com/yijingru/BBAVectors-Oriented-Object-Detection/blob/master/test.py#L167

All you need to do is update 4th parameter i.e. (255,0,255) to other RGB values. You can have a dictionary where you can have different colors for each category mapped here.

Reference: https://docs.opencv.org/4.5.2/d6/d6e/group__imgproc__draw.html#ga746c0625f1781f1ffc9056259103edbc

Hello @dineshdaultani, Thank you so much for your guidance. I will try to define a dictionary.