kuangliu / pytorch-retinanet

RetinaNet in PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

chuxiang93 opened this issue · 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?

I meet the same problem, have u fixed this?

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

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

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

感谢!我去试试!

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?

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?

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

pytorch-retinanet/utils.py

Lines 180 to 183 in 2d7c663

xx1 = x1[order[1:]].clamp(min=x1[i])
yy1 = y1[order[1:]].clamp(min=y1[i])
xx2 = x2[order[1:]].clamp(max=x2[i])
yy2 = y2[order[1:]].clamp(max=y2[i])

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

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

pytorch-retinanet/utils.py

Lines 180 to 183 in 2d7c663

xx1 = x1[order[1:]].clamp(min=x1[i])
yy1 = y1[order[1:]].clamp(min=y1[i])
xx2 = x2[order[1:]].clamp(max=x2[i])
yy2 = y2[order[1:]].clamp(max=y2[i])

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?

??

Anybody figure this out??

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

感谢!我去试试!

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

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

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

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