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

Bug: Target["area"] incorrect when using selective_search (and possibly others) #57

Closed AZaitzeff closed 2 years ago

AZaitzeff commented 2 years ago

The selective_search function changes the boxes to xyxy coordinates. boxes[..., 2] = boxes[..., 0] + boxes[..., 2] boxes[..., 3] = boxes[..., 1] + boxes[..., 3]

In [__get_item__] (https://github.com/amirbar/DETReg/blob/36ae5844183499f6bc1a6d8922427b0f473e06d9/datasets/selfdet.py#L67)
we have boxes = selective_search(img, h, w, res_size=128) ... target['boxes'] = torch.tensor(boxes) ... target['area'] = target['boxes'][..., 2] * target['boxes'][..., 3]

But boxes at this point on in xyxy not cxcywh, So the "area" is incorrect. I do not know if this effects anything down the line, it may not.

AZaitzeff commented 2 years ago

After looking through the code I am pretty sure that "area" never gets used