qubvel-org / segmentation_models.pytorch

Semantic segmentation models with 500+ pretrained convolutional and transformer-based backbones.
https://smp.readthedocs.io/
MIT License
9.6k stars 1.67k forks source link

Guidance required to add CBAM Module #908

Closed jawi289o closed 1 month ago

jawi289o commented 2 months ago

Can you please guide how can I add the CBAM module in UNet and Deeplabv3p?

cbam

qubvel commented 2 months ago

Hi @jawi289o there is a similar attention module SCSE

https://github.com/qubvel-org/segmentation_models.pytorch/blob/c68fc942408f7ead3fd64e866204980b05a6bfb0/segmentation_models_pytorch/base/modules.py#L49-L62

https://github.com/qubvel-org/segmentation_models.pytorch/blob/c68fc942408f7ead3fd64e866204980b05a6bfb0/segmentation_models_pytorch/base/modules.py#L117-L129

So, you can just specify decoder_attention_type="scse", or if there is any difference you can add it to the file