open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.62k stars 9.47k forks source link

Can I just add one feature map? #4752

Closed SeongjaeHong closed 3 years ago

SeongjaeHong commented 3 years ago

https://github.com/open-mmlab/mmdetection/blob/dbc6b67446d3898461d0a5d5cef7d112e710db0a/mmdet/models/roi_heads/roi_extractors/single_level_roi_extractor.py#L99-L107

If the goal is to use every feature map, then can I just shorten the above code like this ?

roi_feats = feats[i].sum() * 0.

If it's not possible, can you please explain the reason?

jshilong commented 3 years ago
        bbox_roi_extractor=dict(
            type='SingleRoIExtractor',
            roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
            out_channels=256,
            featmap_strides=[4, 8, 16, 32]),

You can add the corresponding stride to the featmap_strides.

jshilong commented 3 years ago

Feel free to reopen the issue if there is any question.