kuangliu / pytorch-retinanet

RetinaNet in PyTorch
992 stars 250 forks source link

There are too many prediction boxes, although the loss is very low. #71

Open chuxiang93 opened 4 years ago

chuxiang93 commented 4 years ago

I can reduce my loss in both the training dataset and the test dataset to about 0.02, but my output of prediction visualization results is completely wrong, because there are too many prediction boxes. Does anybody have the same situation?

lizhiyuanUSTC commented 4 years ago

I meet the same problem, have u fixed this?

07hyx06 commented 4 years ago

i meet the same problem, have u fixed this? @lizhiyuanUSTC @tianmaliuixing @kuangliu

lizhiyuanUSTC commented 4 years ago

The code is correct, but the box info I prepared is wrong. You can check the box info: x1, y1, x2, y2, label

07hyx06 commented 4 years ago

The code is correct, but the box info I prepared is wrong. You can check the box info: x1, y1, x2, y2, label

感谢!我去试试!

imbibekk commented 4 years ago

The code is correct, but the box info I prepared is wrong. You can check the box info: x1, y1, x2, y2, label

How did you solve the problem of getting too many prediction boxes?

LyulinAnton commented 4 years ago

The code is correct, but the box info I prepared is wrong. You can check the box info: x1, y1, x2, y2, label

The data is correct. Has anyone solved this problem?

786102906 commented 4 years ago

I think the nms code is wrong in utlis.py.https://github.com/kuangliu/pytorch-retinanet/blob/2d7c663350f330a34771a8fa6a4f37a2baa52a1d/utils.py#L180-L183 the 'max' should be 'min', and the 'min' should be 'max'

chuxiang93 commented 4 years ago

I think the nms code is wrong in utlis.py.

https://github.com/kuangliu/pytorch-retinanet/blob/2d7c663350f330a34771a8fa6a4f37a2baa52a1d/utils.py#L180-L183

the 'max' should be 'min', and the 'min' should be 'max'

I think you are right. But i have no time to test and verify if there are any other mistakes. Have you tested it? Can you inform the result?

Note-Liu commented 4 years ago

??

michaelliu2 commented 3 years ago

Anybody figure this out??

mayuelala commented 3 years ago

The code is correct, but the box info I prepared is wrong. You can check the box info: x1, y1, x2, y2, label

感谢!我去试试!

麻烦问一下,你的数据集是什么样子的,跑通了吗

chenchao666 commented 3 years ago

I also got many boxes, is there anyone solved this problem

laikas123 commented 2 years ago

This appears to occur if you have too little training data. I tried this demo from Pytorch: https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html

Using their full dataset it gives one box per prediction.

Then I tried on my (very small) dataset and got too many boxes per prediction.

So I went back and reduced the training size in the Pytorch demo and same thing happened, too many prediction boxes, so I believe this is the issue.

(My guess is maybe if the model doesn't feel certain enough it gives predictions and their probabilities rather than a distinct prediction?)

gordenxu commented 1 year ago

i think u can adjust the thres in decode。 CLS_THRESH = 0.5 can be higher,NMS_THRESH = 0.5 can be lower