daodaofr / AlignPS

Code for CVPR 2021 paper: Anchor-Free Person Search
Apache License 2.0
167 stars 34 forks source link

The effect of subtracting the mean value of p3 #20

Closed qixiong-wang closed 3 years ago

qixiong-wang commented 3 years ago

Hi, thanks for your excellent work. When I try to reimplement the result of scale alignment, I find you substract the mean value of feature map p3 in mmdet/models/dense_heads/fcos_reid_head_focal_sub_triqueue.py as follow:

        h, w = feats[0].shape[2], feats[0].shape[3]
        mean_value = nn.functional.adaptive_avg_pool2d(feats[0], 1)
        mean_value = F.upsample(input=mean_value, size=(h, w), mode='bilinear')
        feats[0] = feats[0] - mean_value

And I remove this part, the performance decreases to mAP = 90.82%. I wonder how it works and if I need to add this operation in other levels of feature map.

daodaofr commented 3 years ago

We use this operation to normalize the features in an image, similar to layer norm. We also tried to remove this operation, the model also achieves ~93% in mAP. Because we only use the last layer as re-id feature, we didn't try to normalize other layers.

qixiong-wang commented 3 years ago

We use this operation to normalize the features in an image, similar to layer norm. We also tried to remove this operation, the model also achieves ~93% in mAP. Because we only use the last layer as re-id feature, we didn't try to normalize other layers.

Thanks for your reply.