ZhangGongjie / SAM-DETR

[CVPR'2022] SAM-DETR & SAM-DETR++: Official PyTorch Implementation
MIT License
300 stars 51 forks source link

Obtain Query POS Embeddings in Semantically Aligner #12

Open jiaozhiqiang opened 1 year ago

jiaozhiqiang commented 1 year ago

Thank you very much for your contribution! I want to know why the Query POS Embedding in Semantically Aligner has the operation of "*0.5" before it passes through Sin POS Embedding. https://github.com/ZhangGongjie/SAM-DETR/blob/df4e5676765ab0d1a65a82da89989309f399f3ef/models/transformer_decoder.py#L256

I look forward to your valuable reply,Thank you.

ZhangGongjie commented 1 year ago

reference_boxes[:, :, 2:] represents the width and height of the reference boxes. We wish to control the sampling space within the reference space, so we multiply it by 0.5 as the scale of spatial sampling.