Download fold2/WNets.py from soumickmj/DILITHIUM_UnSup_WNetMSS3D: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/soumickmj/DILITHIUM_UnSup_WNetMSS3D/resolve/main/fold2/WNets.py
- Command line
-
hf download hf://soumickmj/DILITHIUM_UnSup_WNetMSS3D/fold2/WNets.py
-
curl -L -o WNets.py https://huggingface.co/soumickmj/DILITHIUM_UnSup_WNetMSS3D/resolve/main/fold2/WNets.py
1.35 kB
| from transformers import PreTrainedModel | |
| from .w_net_3d import WNet3dUNet, WNet3dAttUNet, WNet3dUNetMSS | |
| from .attention_unet3d import AttUnet # noqa: F401 (makes local-folder loading copy this file) | |
| from .unet3d import UNet, UNetDeepSup # noqa: F401 | |
| from .WNetConfigs import WNet3DConfig, AttWNet3DConfig, WNetMSS3DConfig | |
| class WNet3D(PreTrainedModel): | |
| config_class = WNet3DConfig | |
| def __init__(self, config): | |
| super().__init__(config) | |
| self.model = WNet3dUNet( | |
| in_ch=config.in_ch, | |
| out_ch=config.out_ch, | |
| init_features=config.init_features) | |
| def forward(self, x): | |
| return self.model(x) | |
| class AttWNet3D(PreTrainedModel): | |
| config_class = AttWNet3DConfig | |
| def __init__(self, config): | |
| super().__init__(config) | |
| self.model = WNet3dAttUNet( | |
| in_ch=config.in_ch, | |
| out_ch=config.out_ch, | |
| init_features=config.init_features) | |
| def forward(self, x): | |
| return self.model(x) | |
| class WNetMSS3D(PreTrainedModel): | |
| config_class = WNetMSS3DConfig | |
| def __init__(self, config): | |
| super().__init__(config) | |
| self.model = WNet3dUNetMSS( | |
| in_ch=config.in_ch, | |
| out_ch=config.out_ch, | |
| init_features=config.init_features) | |
| def forward(self, x): | |
| return self.model(x) |