facebookresearch / detr

End-to-End Object Detection with Transformers
Apache License 2.0
13.08k stars 2.37k forks source link

Queries for images with low number of objects #620

Closed dokeefemain closed 5 months ago

dokeefemain commented 6 months ago

Hello, in my dataset has 2 classes and there is a maximum of 2 objects per image. I'm curious as to what I should set my n_queries to be. Logically 2 would make sense but I'm not sure what effect that might have on the models ability to learn. I read through the paper and it doesn't seem to go into a case like this so I was just wanting to get some other peoples thoughts on this.

dokeefemain commented 6 months ago

I've tested 2, 3, 5, 10, and 20 and 3 seems to be the sweet spot. Still, if anyone has some thoughts on this I'm all ears

guillaume-troadec commented 5 months ago

Typically I set num_queries to be slightly larger than the max number of classes the model is expected to predict. $3$ seems reasonable for your case