Spaces:
Sleeping
Sleeping
Download model_code/conv3_reference.py from oussamab2n/GazeLIFT: direct link, hf CLI and curl.
- Browser
- Download file 631 Bytes
-
https://huggingface.co/spaces/oussamab2n/GazeLIFT/resolve/main/model_code/conv3_reference.py
- Command line
-
hf download hf://spaces/oussamab2n/GazeLIFT/model_code/conv3_reference.py
-
curl -L -o conv3_reference.py https://huggingface.co/spaces/oussamab2n/GazeLIFT/resolve/main/model_code/conv3_reference.py
631 Bytes
| """Pyramid DINO projections with single 3x3 decoder convolutions.""" | |
| from torch import nn | |
| from pyramid_reference import PyramidPointwiseRGBWaveletDecoder | |
| from base_model import segmentation_loss | |
| class PyramidConv3RGBWaveletDecoder(PyramidPointwiseRGBWaveletDecoder): | |
| def __init__(self): | |
| super().__init__() | |
| self.decoder=nn.ModuleList([nn.Sequential(nn.Conv2d(cin,32,3,padding=1,bias=False),nn.GroupNorm(8,32),nn.GELU()) for cin in [44,44,44,44,35]]) | |
| for layer in self.decoder.modules(): | |
| if isinstance(layer,nn.Conv2d):nn.init.kaiming_normal_(layer.weight,mode='fan_out',nonlinearity='relu') | |