amirbar / DETReg

Official implementation of the CVPR 2022 paper "DETReg: Unsupervised Pretraining with Region Priors for Object Detection".
https://amirbar.net/detreg
Apache License 2.0
334 stars 46 forks source link

Matching predictions and targets that belong to different images #31

Closed avecplezir closed 2 years ago

avecplezir commented 2 years ago

Hi! Thank you for your code and work!

It seems that it is possible to match predictions of image A with targets of image B if the batch is bigger than one. Does it lead to the potentially worse solution when finetuning on COCO and pertaining?

https://github.com/amirbar/DETReg/blob/4f9cb9aac896110562b0a36c2c932fb25b5e4a54/models/matcher.py#L73

amirbar commented 2 years ago

The batch dim is indeed flattened, but the following line should allow matching a source label only to a target in the corresponding image, specifically look at C.split: https://github.com/amirbar/DETReg/blob/4f9cb9aac896110562b0a36c2c932fb25b5e4a54/models/matcher.py#L95