Spaces:
Sleeping
Sleeping
Download model/CBAM/cbam.py from Pavan2k4/Building_area: direct link, hf CLI and curl.
- Browser
- Download file 389 Bytes
-
https://huggingface.co/spaces/Pavan2k4/Building_area/resolve/main/model/CBAM/cbam.py
- Command line
-
hf download hf://spaces/Pavan2k4/Building_area/model/CBAM/cbam.py
-
curl -L -o cbam.py https://huggingface.co/spaces/Pavan2k4/Building_area/resolve/main/model/CBAM/cbam.py
389 Bytes
| import torch | |
| import torch.nn as nn | |
| from channel_att import Channel_attention | |
| from spatial_att import Spatial_attention | |
| class CBAM(nn.Module): | |
| def __init__(self, ch): | |
| super().__init__() | |
| self.channel = Channel_attention(ch) | |
| self.spatial = Spatial_attention() | |
| def forward(self, x): | |
| x1 = self.channel(x) | |
| x2 = self.spatial(x1) | |
| return x2 |