haofeixu / aanet

[CVPR'20] AANet: Adaptive Aggregation Network for Efficient Stereo Matching
Apache License 2.0
524 stars 102 forks source link

Are the deformable convs customised? #33

Closed qizhuli closed 4 years ago

qizhuli commented 4 years ago

Hi, thank you for the great work and for open sourcing your code.

I wonder whether the (modulated) deformable convolutions used here have been customised / modified in anyway and whether they are any different -- in theory -- from the standard off-the-shelf implementations (e.g., the ones found in mmdetection and maskrcnn_benchmark)?

haofeixu commented 4 years ago

No, it's directly taken from mmdetection.

qizhuli commented 4 years ago

Thanks for clarifying! One thing I don't fully understand is the double_mask option in deformable convs (https://github.com/haofeixu/aanet/blob/master/nets/deform.py#L81-L82). It looks like your settings uses double_mask=True for the experiments. So my understanding is that without double_mask, mask values are in (0, 1), and with it, the mask range becomes (0, 2). Why would you want/need to double the mask values?

haofeixu commented 4 years ago

Sorry for the inaccurate reply before. To be more precise, the cuda implementation of deformable conv is directly taken from mmdetection, but the mask computation has a subtle difference with mmdetection. As you have noted, we double the mask so that its initialization value is 1 (sigmoid(0) is 0.5). The inituition is that we want the initial deformable conv to work as a regular conv layer (i.e., offset is 0, mask is 1).