Download image_scale.py from TSE1966/Super-Resolution-Anime-Diffusion: direct link, hf CLI and curl.
- Browser
- Download file 715 Bytes
-
https://huggingface.co/spaces/TSE1966/Super-Resolution-Anime-Diffusion/resolve/main/image_scale.py
- Command line
-
hf download hf://spaces/TSE1966/Super-Resolution-Anime-Diffusion/image_scale.py
-
curl -L -o image_scale.py https://huggingface.co/spaces/TSE1966/Super-Resolution-Anime-Diffusion/resolve/main/image_scale.py
715 Bytes
| # -*- coding: utf-8 -*- | |
| # file: image_scale.py | |
| # time: 06/12/2022 | |
| # author: yangheng <hy345@exeter.ac.uk> | |
| # github: https://github.com/yangheng95 | |
| # huggingface: https://huggingface.co/yangheng | |
| # google scholar: https://scholar.google.com/citations?user=NPq5a_0AAAAJ&hl=en | |
| # Copyright (C) 2021. All Rights Reserved. | |
| import os | |
| import findfile | |
| import tqdm | |
| from Waifu2x import ImageMagnifier | |
| magnifier = ImageMagnifier() | |
| if __name__ == "__main__": | |
| # path = os.getcwd() | |
| # for f in findfile.find_cwd_files(or_key=[".jpg", ".png"]): | |
| for f in tqdm.tqdm( | |
| findfile.find_files(r"C:\Users\chuan\OneDrive\imgs", or_key=[".jpg", ".png"]) | |
| ): | |
| img = magnifier.magnify_from_file(f, scale_factor=2) | |