qfgaohao / pytorch-ssd

MobileNetV1, MobileNetV2, VGG based SSD/SSD-lite implementation in Pytorch 1.0 / Pytorch 0.4. Out-of-box support for retraining on Open Images dataset. ONNX and Caffe2 support. Experiment Ideas like CoordConv.
https://medium.com/@smallfishbigsea/understand-ssd-and-implement-your-own-caa3232cd6ad
MIT License
1.39k stars 529 forks source link

For training images with all 0 labels, change made in box_utils.hard_negative_mining. #159

Open ta012 opened 3 years ago

ta012 commented 3 years ago

Currently images with all 0 labels are not used in loss calculation. So change made in box_utils.hard_negative_mining to accommodate images with all 0 labels. The idea is that 0 is considered only in classification loss, not in bbox regression loss. A batch should contain at least one positive label.