pytorch-retinanet icon indicating copy to clipboard operation
pytorch-retinanet copied to clipboard

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

Open chuxiang93 opened this issue 5 years ago • 14 comments

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?

chuxiang93 avatar Oct 12 '19 03:10 chuxiang93

I meet the same problem, have u fixed this?

lizhiyuanUSTC avatar Oct 25 '19 08:10 lizhiyuanUSTC

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

07hyx06 avatar Nov 01 '19 04:11 07hyx06

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

lizhiyuanUSTC avatar Nov 04 '19 07:11 lizhiyuanUSTC

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

感谢!我去试试!

07hyx06 avatar Nov 04 '19 12:11 07hyx06

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?

imbibekk avatar Nov 12 '19 09:11 imbibekk

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?

LyulinAnton avatar Nov 20 '19 10:11 LyulinAnton

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'

786102906 avatar Dec 13 '19 08:12 786102906

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?

chuxiang93 avatar Dec 13 '19 08:12 chuxiang93

??

Note-Liu avatar Jan 08 '20 13:01 Note-Liu

Anybody figure this out??

michaelliu2 avatar Sep 13 '20 23:09 michaelliu2

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

感谢!我去试试!

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

mayuelala avatar Nov 14 '20 03:11 mayuelala

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

chenchao666 avatar May 07 '21 07:05 chenchao666

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?)

laikas123 avatar Feb 16 '22 18:02 laikas123

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

gordenxu avatar Sep 25 '22 05:09 gordenxu