Spaces:
Sleeping
Sleeping
Download model/decoder.py from Pavan2k4/Building_area: direct link, hf CLI and curl.
- Browser
- Download file 493 Bytes
-
https://huggingface.co/spaces/Pavan2k4/Building_area/resolve/main/model/decoder.py
- Command line
-
hf download hf://spaces/Pavan2k4/Building_area/model/decoder.py
-
curl -L -o decoder.py https://huggingface.co/spaces/Pavan2k4/Building_area/resolve/main/model/decoder.py
493 Bytes
| import torch | |
| import torch.nn as nn | |
| import torch.functional as F | |
| from bn import batch_norm | |
| from residual import residual | |
| class decoder(nn.Module): | |
| def __init__(self, inp, out): | |
| super().__init__() | |
| self.upsample = nn.Upsample(scale_factor=2, mode = 'bilinear', align_corners = True) | |
| self.block = residual(inp+out, out) | |
| def forward(self, x, skip): | |
| x = self.upsample(x) | |
| x = torch.cat([x, skip], axis = 1) | |
| x = self.block(x) | |
| return x |