XinzeLee/PolygonObjectDetection

NMS time limit 10.0s exceeded

tak-s opened this issue ยท 10 comments

tak-s commented

Thanks for sharing great works!

I am trying to train coco dataset.
When calculating mAP for val data, I got bellow warning.

WARNING: NMS time limit 10.0s exceeded

I think when found many bbox, nms cost is too much. then time limit exceeded.

So, I set/change conf_thres=0.1(default is 0.001), it's work no warning.

But, I am afraid that this change will affect learning performance. What do you think?

It is correct that if increasing the conf_thres to a higher value (like 0.01) can work without warning. But modify the conf_thres from 0.001 to above may affect the "actual" evaluation of the final performance.
By the way, it is quite normal for the warning in the early stages of the training, since the network is still learning the characteristics of the classes. As a result, in early-stage, the network "almost-randomly" gives a lot of guesses, since it is not sure about the correct characteristics! After some training epochs (maybe several tens or hundreds, depending on dataset), the network will be more certain about its predictions, and the warning will disappear naturally.

tak-s commented

Thank you.
I understood it well.

By the way, do you train with the COCO dataset?
I trained 300 epochs. I got mAP@.5=0.31 and mAP_0.5:0.95=0.16 with yolov5-s. Is this are reasonable?
image

I haven't tried the full coco dataset. It is really good that you did the experiments!

I have tried with a small portion of classes of coco, such as beds, couch, cups, laptop, monitor, remotes, etc. From my perspective, the performance of mAP@.5=0.31 and mAP_0.5:0.95=0.16 are already pretty good considering that polygon labels are much harder than bbox (cx, cy, width, height). Intuitively, to get good performance for polygon labels, we need more data than bbox labels.

Can I check with you how did you get the polygon labels for coco dataset? Did you use the Polygon-Tutorial 2 to convert the segmentation labels to polygon labels? If that so, there might be a intrinsic vital problem with the labels: some segmentations are disjointed. These kinds of labels might cause trouble for the model to learn.
ๆ•่Žท

tak-s commented

Oh, that's right.
Now my annotation for this repository is separated...

image

This annotation are two bag, two people. But, the correct polygon annotation is one bag and one person.

I will try to fix it.

Yes, that is the case. If you found something, please let me know. Thanks!

tak-s commented

Hi.
At seg2poly()

                    # if not crowded, use segmentation
                    if not object0['iscrowd']:
                        segments = [oneD2twoD(segment+segment[:2]) 
                                           for segment in object0['segmentation']]

change to below.

                    # if not crowded, use segmentation
                    if not object0['iscrowd']:
                        segments = []
                        for segment in object0['segmentation']:
                            segments.extend(oneD2twoD(segment+segment[:2]))
                        segments = [segments]

Since the separated information is connected, a connecting line is drawn when plotting, but I think that there is no problem in finding the quadrangle with minimum_rotated_rectangle.

image

Really nice work! The disjointed problems for some connective objects are solved. But I have observed another issue: for class like "skis" as follows, both of the skis on left foot and right foot are connected together. I further looked into the coco dataset, and found that "pair of skis" is considered as a whole. Is that true?
ๅ›พ็‰‡

Thanks for your help! I will definitely mention your contribution in the new version of codes! Also, if it is possible, can you train the polygon-yolov5s on the new version of labels and test the performance?

tak-s commented

Thank you for checking my code!
I'm glad to contribute this work.

My environment is poor and may take a few days, but I'll try to train with the modified labels.

tak-s commented

I trained with the modified COCO labels on yolo-s based PolygonObjectDetection.
Best model's val score is below:
mAP@.5: = 0.334
mAP@.5:.95= 0.171

results
test_batch2_pred

tak-s commented

On yolox-l,
mAP@.5: = 0.424
mAP@.5:.95= 0.238