CoolFace
Apppublic

TSE1966/Super-Resolution-Anime-Diffusion

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
image_scale.py24 linesDownload Raw Back to root
1# -*- coding: utf-8 -*-2# file: image_scale.py3# time: 06/12/20224# author: yangheng <hy345@exeter.ac.uk>5# github: https://github.com/yangheng956# huggingface: https://huggingface.co/yangheng7# google scholar: https://scholar.google.com/citations?user=NPq5a_0AAAAJ&hl=en8# Copyright (C) 2021. All Rights Reserved.9import os10 11import findfile12import tqdm13 14from Waifu2x import ImageMagnifier15 16magnifier = ImageMagnifier()17if __name__ == "__main__":18    # path = os.getcwd()19    # for f in findfile.find_cwd_files(or_key=[".jpg", ".png"]):20    for f in tqdm.tqdm(21        findfile.find_files(r"C:\Users\chuan\OneDrive\imgs", or_key=[".jpg", ".png"])22    ):23        img = magnifier.magnify_from_file(f, scale_factor=2)24