object_detection_demo icon indicating copy to clipboard operation
object_detection_demo copied to clipboard

No bounding boxes are drawn when I run the colab without any modification with the default data provided

Open balazsbanto opened this issue 3 years ago • 7 comments

Hi! I tried to run the provided colab with small modification but using the data provided in the colab, because otherwise it does not run: just adding %tensorflow_version 1.x, and !pip install tf_slim. The training runs ok, but when I run the inference no bounding boxes are drawn on the images. Do you have any idea why these happens? If I print out output_dict['detection_boxes'], I see a lot of coordinates, but are all below 1.

balazsbanto avatar Oct 08 '20 11:10 balazsbanto

Same problem

a1usha avatar Oct 27 '20 02:10 a1usha

Hi, I found a way to solve this but I don't know that it may work for you.

Methods that you can apply:-

  1. Change selected_model = 'ssd_mobilenet_v2' to selected_model = 'faster_rcnn_inception_v2' and train the model by setting value high for "num_steps" variable. ( By doing this, it worked for me and then bounding boxes were formed on the image )

  2. Try to use another visualization methods to display like for eg, use cv2.imshow(image_np) or cv2_imshow(image_np) instead of plt.imshow(image_np)

Hope this helps.

ADITYA964 avatar Jan 09 '21 18:01 ADITYA964

@ADITYA964 Hi. I have same problem. I tried your suggestion 1. and it worked. But I want to make model for edge-TPU so I need to use ssd_mobilenet_v2. Is there any other solution? With mobilenet v2, training seems to go well but result seems bad. I think mAP value is strange. Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = -1.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = -1.000

Riichiro-Oka avatar Jan 24 '21 03:01 Riichiro-Oka

Hi @Riichiro-Oka, I am glad that it was helpful for you. I am also working to find a solution for it, but it's a mystery to find the cause for the " Mobilenet V2 " model's issue. And I also received the same improper results as you have mentioned above.

ADITYA964 avatar Jan 24 '21 05:01 ADITYA964

Thank you for your reply. I am wondering why person who wrote original notebook could do it well. Anyway, I will also try to find a solution.

Riichiro-Oka avatar Jan 24 '21 08:01 Riichiro-Oka

@ADITYA964 I found the colaboratory training monilenet v2 well. I have not found out why this work but difference is numpy==1.17.5 is installed and iou_threshold = 0.50 is set. https://colab.research.google.com/github/luxonis/depthai-ml-training/blob/master/colab-notebooks/Easy_Object_Detection_With_Custom_Data_Demo_Training.ipynb

Riichiro-Oka avatar Jan 24 '21 10:01 Riichiro-Oka

Oh so it seems that it might be due to versions of package. Thanks for sharing , I needed it.

ADITYA964 avatar Jan 24 '21 14:01 ADITYA964