Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,17 @@ os.system("wget https://huggingface.co/akhaliq/RealBasicVSR_x4/resolve/main/Real
|
|
11 |
sys.path.append("RealBasicVSR")
|
12 |
|
13 |
os.mkdir("test")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
def inference(img):
|
|
|
15 |
img.save("test/test.png")
|
16 |
os.system("python inference_realbasicvsr.py configs/realbasicvsr_x4.py RealBasicVSR_x4.pth test/ results/demo_000")
|
17 |
return "results/demo_000/test.png"
|
@@ -23,4 +33,4 @@ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.127
|
|
23 |
|
24 |
examples=[['mona.jpg']]
|
25 |
|
26 |
-
gr.Interface(inference,gr.inputs.Image(type="pil"
|
|
|
11 |
sys.path.append("RealBasicVSR")
|
12 |
|
13 |
os.mkdir("test")
|
14 |
+
|
15 |
+
|
16 |
+
def resize(width,img):
|
17 |
+
basewidth = width
|
18 |
+
wpercent = (basewidth/float(img.size[0]))
|
19 |
+
hsize = int((float(img.size[1])*float(wpercent)))
|
20 |
+
img = img.resize((basewidth,hsize), Image.ANTIALIAS)
|
21 |
+
return img
|
22 |
+
|
23 |
def inference(img):
|
24 |
+
img = resize(256,img)
|
25 |
img.save("test/test.png")
|
26 |
os.system("python inference_realbasicvsr.py configs/realbasicvsr_x4.py RealBasicVSR_x4.pth test/ results/demo_000")
|
27 |
return "results/demo_000/test.png"
|
|
|
33 |
|
34 |
examples=[['mona.jpg']]
|
35 |
|
36 |
+
gr.Interface(inference,gr.inputs.Image(type="pil"),gr.outputs.Image(type="file"),title=title,description=description,article=article,examples=examples).launch(enable_queue=True)
|