Spaces:
Runtime error
Runtime error
FIX img to image path.
Browse files
app.py
CHANGED
@@ -5,9 +5,10 @@ from PIL import Image
|
|
5 |
|
6 |
os.system('wget https://github.com/JingyunLiang/SwinIR/releases/download/v0.0/003_realSR_BSRGAN_DFO_s64w8_SwinIR-M_x4_GAN.pth -P experiments/pretrained_models')
|
7 |
|
8 |
-
def super_resolution_inference(
|
9 |
os.system('mkdir test')
|
10 |
basewidth = 256
|
|
|
11 |
wpercent = (basewidth/float(img.size[0]))
|
12 |
hsize = int((float(img.size[1])*float(wpercent)))
|
13 |
img = img.resize((basewidth,hsize), Image.ANTIALIAS)
|
|
|
5 |
|
6 |
os.system('wget https://github.com/JingyunLiang/SwinIR/releases/download/v0.0/003_realSR_BSRGAN_DFO_s64w8_SwinIR-M_x4_GAN.pth -P experiments/pretrained_models')
|
7 |
|
8 |
+
def super_resolution_inference(img_path):
|
9 |
os.system('mkdir test')
|
10 |
basewidth = 256
|
11 |
+
img = Image.open(open(img_path, 'rb'))
|
12 |
wpercent = (basewidth/float(img.size[0]))
|
13 |
hsize = int((float(img.size[1])*float(wpercent)))
|
14 |
img = img.resize((basewidth,hsize), Image.ANTIALIAS)
|