tianzhi0549 / FCOS

FCOS: Fully Convolutional One-Stage Object Detection (ICCV'19)
https://arxiv.org/abs/1904.01355
Other
3.28k stars 630 forks source link

Meaningless loss computation when no positive samples #229

Open nnop opened 4 years ago

nnop commented 4 years ago

These codes seems meaningless when computing the loss when there's no positive sample. These regression losses should be 0 when there's no positive sample (e.g. images with only background). In most cases, there are positive samples, so the bug seldom shows up. Were this part not finished?

https://github.com/tianzhi0549/FCOS/blob/dd4ca761f439a48a8c3003d1be74e9f85c050534/fcos_core/modeling/rpn/fcos/loss.py#L277-L282

billyceline commented 4 years ago

It seems that all the training data must have positive samples, if a sample only have background, you don't need to train it at all.

tomorrow1210 commented 4 years ago

If some images in dataset have not positive samples, the training process may do not fit. You can filter these samples in advance, then it will done.