question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Multiple detections" problem during inference

See original GitHub issue

Hello,

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) :

image image image

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:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
fmassacommented, Aug 3, 2020

Hi,

The multiple detections might be due to many things:

  • maybe you need longer training – this depends on the cardinality_error that you have in your logs
  • maybe you need a higher threshold? Currently DETR is calibrated in such a way that it requires a fairly high threshold for detections.

I think the num_queries being 100 is not necessarily the issue here, I think it should be fine.

0reactions
fmassacommented, Aug 13, 2020

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Single-Shot Detector with Multiple Inference Paths - IEEE Xplore
To address this problem, we propose a single-shot detector with multiple inference paths based on a multi-scale DenseNet.
Read more >
5 Significant Object Detection Challenges and Solutions
Single-shot detectors must place special emphasis on the issue of multiple scales because they detect objects with a single pass through the CNN ......
Read more >
Detecting inference attacks involving sensor data in a multi ...
In this paper, we motivate the need of a distributed inference detection system acting in a general multi-database context and we highlight the ......
Read more >
The inference results; the detection accuracy and the distance ...
Context in source publication ... ... most effective training to testing dataset ratio and checkpoint was investigated by inferencing the trained models with ......
Read more >
Object detection using YOLO: challenges, architectural ...
Performance of any object detector is evaluated through detection accuracy and inference time. Generally, the detection accuracy of two ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found