ChenhongyiYang / QueryDet-PyTorch

[CVPR 2022 Oral] QueryDet: Cascaded Sparse Query for Accelerating High-Resolution Small Object Detection
MIT License
423 stars 46 forks source link

why you set the offset to 0.5 in the `query_anchor_generator`? #70

Open simon1624 opened 1 year ago

simon1624 commented 1 year ago

why you set the offset to 0.5 in the query_anchor_generator? In the anchor_generator,you use the default setting and set the offset to 0. Can you tell me why? I'm so confused.

self.query_anchor_generator = AnchorGeneratorWithCenter(sizes=[128], aspect_ratios=[1.0], 
                                                                strides=[2**(x+2) for x in self.query_layer_train], offset=0.5) 
simon1624 commented 1 year ago

This results in the difference between all_centers[1:2] and query_centers, which refer to the same feature map. So, there are two different mapping between the same feature and the original input image. I can't find the reason from your paper, can you explain it? Thank you.

ChenhongyiYang commented 1 year ago

Hi,

Thank you for reaching out.

The query_anchor_generator is set here for convenience, so we can easily get the center location of each feature grid.

simon1624 commented 1 year ago

Hi,

Thank you for reaching out.

The query_anchor_generator is set here for convenience, so we can easily get the center location of each feature grid.

Thank you for you replying.

But in the anchor_generator, you set offset to 0. What I want to know is that all_centers[1:3] and query_centers is generated by the same level featurre map, but all_centers[1][0]=[0,0] and query_centers[0][0]=[4,4]. It's this difference that I can't understand. Why map the same feature grid to different locations?