Spaces:
Runtime error
Runtime error
Download ram/transform.py from rishirajpathak/SuperResolution: direct link, hf CLI and curl.
- Browser
- Download file 356 Bytes
-
https://huggingface.co/spaces/rishirajpathak/SuperResolution/resolve/main/ram/transform.py
- Command line
-
hf download hf://spaces/rishirajpathak/SuperResolution/ram/transform.py
-
curl -L -o transform.py https://huggingface.co/spaces/rishirajpathak/SuperResolution/resolve/main/ram/transform.py
356 Bytes
| from torchvision.transforms import Normalize, Compose, Resize, ToTensor | |
| def convert_to_rgb(image): | |
| return image.convert("RGB") | |
| def get_transform(image_size=384): | |
| return Compose([ | |
| convert_to_rgb, | |
| Resize((image_size, image_size)), | |
| ToTensor(), | |
| Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) | |
| ]) | |