Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ os.makedirs('result')
|
|
44 |
|
45 |
## resize if necessary (not used)
|
46 |
def resize(img):
|
47 |
-
max_side =
|
48 |
w = img.size[0]
|
49 |
h = img.size[1]
|
50 |
if max(h, w) > max_side:
|
@@ -57,9 +57,9 @@ def resize(img):
|
|
57 |
#################### low res ##################
|
58 |
## inference
|
59 |
def inference(LR, Ref):
|
60 |
-
## resize for user selected input
|
61 |
-
|
62 |
-
|
63 |
|
64 |
## Input setup (creates folders and places inputs corresponding to the original RefVSR code)
|
65 |
LR.save(os.path.join(LR_path, '0000.png'))
|
@@ -82,14 +82,14 @@ def inference(LR, Ref):
|
|
82 |
--is_gradio")
|
83 |
return "result/0000.png"
|
84 |
|
85 |
-
title="RefVSR"
|
86 |
description="Demo application for Reference-based Video Super-Resolution (RefVSR). Upload a low-resolution frame and a reference frame to 'LR' and 'Ref' input windows, respectively. The demo runs on CPUs and takes about 150s."
|
87 |
|
88 |
-
article = "<p style='text-align: center'><b>To check the full capability of the module, we recommend to clone Github repository and run RefVSR models on videos using GPUs.</b></p><p style='text-align: center'>This demo runs on CPUs and only supports RefVSR for a single LR and Ref frame due to computational complexity. Hence, the model will not take advantage of temporal LR and Ref frames.</p><p style='text-align: center'>The model is trained by the proposed pre-training strategy only. The sample frames are in
|
89 |
|
90 |
-
## resize for sample
|
91 |
-
|
92 |
-
|
93 |
|
94 |
## input
|
95 |
examples=[['LR.png', 'Ref.png']]
|
|
|
44 |
|
45 |
## resize if necessary (not used)
|
46 |
def resize(img):
|
47 |
+
max_side = 430
|
48 |
w = img.size[0]
|
49 |
h = img.size[1]
|
50 |
if max(h, w) > max_side:
|
|
|
57 |
#################### low res ##################
|
58 |
## inference
|
59 |
def inference(LR, Ref):
|
60 |
+
## resize for user selected input
|
61 |
+
LR = resize(LR)
|
62 |
+
Ref = resize(Ref)
|
63 |
|
64 |
## Input setup (creates folders and places inputs corresponding to the original RefVSR code)
|
65 |
LR.save(os.path.join(LR_path, '0000.png'))
|
|
|
82 |
--is_gradio")
|
83 |
return "result/0000.png"
|
84 |
|
85 |
+
title="RefVSR | 4xSR on a single low-resolution frame (480x270)"
|
86 |
description="Demo application for Reference-based Video Super-Resolution (RefVSR). Upload a low-resolution frame and a reference frame to 'LR' and 'Ref' input windows, respectively. The demo runs on CPUs and takes about 150s."
|
87 |
|
88 |
+
article = "<p style='text-align: center'><b>To check the full capability of the module, we recommend to clone Github repository and run RefVSR models on videos using GPUs.</b></p><p style='text-align: center'>This demo runs on CPUs and only supports RefVSR for a single LR and Ref frame due to computational complexity. Hence, the model will not take advantage of temporal LR and Ref frames.</p><p style='text-align: center'>The model is trained by the proposed pre-training strategy only. The sample frames are in 480x270 resolution and saved in the PNG format</p><p style='text-align: center'>For user given frames, the size will be adjusted for the longer side to have 480 pixels.</p><p style='text-align: center'><a href='https://junyonglee.me/projects/RefVSR' target='_blank'>Project</a> | <a href='https://arxiv.org/abs/2203.14537' target='_blank'>arXiv</a> | <a href='https://github.com/codeslake/RefVSR' target='_blank'>Github</a></p>"
|
89 |
|
90 |
+
## resize for sample
|
91 |
+
LR = resize(Image.open('LR.png')).save('LR.png')
|
92 |
+
Ref = resize(Image.open('Ref.png')).save('Ref.png')
|
93 |
|
94 |
## input
|
95 |
examples=[['LR.png', 'Ref.png']]
|