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

how to turn on nms in run_ssd_batch.py #149

Open ynjiun opened 3 years ago

ynjiun commented 3 years ago

I run run_ssd_batch.py and found there are a lot of overlapped bounding boxes output with different confidence level. I assume that nms should remove the lower confidence overlapped bounding boxes and only keep the highest confidence bounding boxes. I wonder the default nms is not turn on and could anyone advise how to turn on nms? and also what does it mean nms="hard" and "soft"? Thanks a lot for your help.

ynjiun commented 3 years ago

figured out why "a lot of overlapped bounding boxes output": this is because the nms algorithms only apply to the same class_index in the vision/ssd/predictor.py. If different class_index with overlap greater than iou_threshold, then it would not be be suppressed thus "a lot of overlapped bounding boxes" show up with different class labels even the highest probability one is correct label. Well, both the predictor and nms need to be revised to suppress across all classes.

lweicker commented 3 years ago

Hello,

Can you please tell me where did you find run_ssd_batch.py file?