File size: 715 Bytes
9842c28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- 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)