ssd.pytorch icon indicating copy to clipboard operation
ssd.pytorch copied to clipboard

Training when images may not have any ground truth bboxes

Open pyaf opened this issue 7 years ago • 6 comments
trafficstars

Hi,

I've a dataset which has images which may or may not have ground truth boxes. I've tweaked the dataloader and MultiboxLoss accordingly. In cases where the image doesn't have any ground truth bbox, loss_l is zero (because all default boxes are negative, and loss_l is computed only for positive default boxes) and I take top 10 negative default boxes (HNM) and compute loss_c. Normally, the loss is averaged out using the number of positive default boxes, what about the case I mentioned, where we don't have any positive default box? or what else I should take into account in such case.

pyaf avatar Oct 04 '18 09:10 pyaf

I also meet the same question.Have you solved it?

Lin-Zhipeng avatar Oct 27 '18 14:10 Lin-Zhipeng

I set [0,0,0,0] as a box for those cases and it works pretty well. (All the priors come out to be negative, so no loc_loss for them and all of them are expected to be background for cls_loss computation).

pyaf avatar Oct 27 '18 17:10 pyaf

That also solved my problem. Thanks.

Lin-Zhipeng avatar Oct 31 '18 03:10 Lin-Zhipeng

@pyaf hello, did you ever trained SSD for coco keypoints dataset?

eng100200 avatar Feb 09 '19 08:02 eng100200

@pyaf can you post the code you used please? i use [0, 0, 0, 0] as a box and I still get a loc_loss != 0 What are the modifications you implemented in multibox_loss.py? Thank you!

rvainshtein avatar Aug 20 '19 06:08 rvainshtein

@pyaf can you post the code you used please? i use [0, 0, 0, 0] as a box and I still get a loc_loss != 0 What are the modifications you implemented in multibox_loss.py? Thank you!

have you tried implementing this?

sidnetopia avatar Nov 03 '22 03:11 sidnetopia