"Multiple detections" problem during inference
See original GitHub issueHello,
I imported a pre-trained model and trained it with my own dataset with these commands for the import :
#!wget https://dl.fbaipublicfiles.com/detr/detr-r50-e632da11.pth
checkpoint=torch.load("detr-r50-e632da11.pth",map_location='cpu')
del checkpoint["model"]["class_embed.weight"]
del checkpoint["model"]["class_embed.bias"]
torch.save(checkpoint,"test_logo.pth")
The model works pretty well but the problem is that sometimes it detects multiple bounding boxes for the same object and I don’t know how to correct it … Here are some examples (for your understanding, the model is trained to detect logos like Airbus, or Peugeot) :
Shouldn’t it keep only the box with the higher score ? And so avoid the multiple detections ?
Does this problem comes from the fact that the num_queries
is set to 100 in the downloaded pretrained model ? My dataset only contains up to 20 logos per image maximum, so maybe num_queries
is too high and it forces the model to detect more objects than it should …?
But if I change the num_queries
when I make the training I have a dimension error so I don’t know how to change the num_queries
for my model anyway…
And if the “multiple detection” problem does not come from the num_queries
parameter, could you please tell me how to solve it ?
Any help would be very much appreciated 🙏 Thank you all !
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
Hi,
The multiple detections might be due to many things:
cardinality_error
that you have in your logsI think the
num_queries
being 100 is not necessarily the issue here, I think it should be fine.@hzphzp we don’t use it for mAP computation, and we have explained it in more detail in https://github.com/facebookresearch/detr/issues/201