File size: 557 Bytes
b443508
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import cv2
from upcunet_v3 import RealWaifuUpScaler
import traceback
import gradio as gr


def greet(input_img):
    print(input_img.shape)
    result = upscaler(input_img, tile_mode=2)
    print(result.shape)
    return result


if __name__ == '__main__':
    ModelPath = "weights_v3/"
    ModelName = "up2x-latest-no-denoise.pth"
    upscaler = RealWaifuUpScaler(2, ModelPath + ModelName, half=False, device="cpu")

    inputs = gr.inputs.Image()
    outputs = "image"
    iface = gr.Interface(fn=greet, inputs=inputs, outputs=outputs)
    iface.launch()