Spaces:
Build error
Build error
Download DSRNet/util/__init__.py from Anika232/ReflectionEraserApp: direct link, hf CLI and curl.
- Browser
- Download file 513 Bytes
-
https://huggingface.co/spaces/Anika232/ReflectionEraserApp/resolve/main/DSRNet/util/__init__.py
- Command line
-
hf download hf://spaces/Anika232/ReflectionEraserApp/DSRNet/util/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/Anika232/ReflectionEraserApp/resolve/main/DSRNet/util/__init__.py
513 Bytes
| from .net_utils import * | |
| from .util import * | |
| def load_checkpoint(model, ckpt_path): | |
| checkpoint = torch.load(ckpt_path) | |
| if 'model' in checkpoint: | |
| checkpoint = checkpoint['model'] | |
| if 'state_dict' in checkpoint: | |
| checkpoint = checkpoint['state_dict'] | |
| ckpt = {} | |
| for k, v in checkpoint.items(): | |
| if k.startswith('module.'): | |
| ckpt[k[7:]] = v | |
| else: | |
| ckpt[k] = v | |
| model.load_state_dict(ckpt,strict=False) #strict=False by nami | |