RealBasicVSR / app.py
akhaliq's picture
akhaliq HF Staff
Update app.py
546c80f
raw
history blame
1.36 kB
import os
import sys
os.system("pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.10/index.html")
os.system("pip install mmedit")
os.system("git clone https://github.com/ckkelvinchan/RealBasicVSR.git")
os.chdir("RealBasicVSR")
import gradio as gr
os.system("wget https://huggingface.co/akhaliq/RealBasicVSR_x4/resolve/main/RealBasicVSR_x4.pth")
sys.path.append("RealBasicVSR")
os.mkdir("test")
def inference(img):
img.save("test/test.png")
os.system("python inference_realbasicvsr.py configs/realbasicvsr_x4.py RealBasicVSR_x4.pth test/ results/demo_000")
return "results/demo_000/test.png"
title="RealBasicVSR"
description="Gradio demo for Investigating Tradeoffs in Real-World Video Super-Resolution. To use it, simply upload your image or click on one of the examples to load them. Read more at the links below."
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2111.12704' target='_blank'>Investigating Tradeoffs in Real-World Video Super-Resolution</a> | <a href='https://github.com/ckkelvinchan/realbasicvsr' target='_blank'>Github Repo</a></p>"
examples=[['/home/user/app/RealBasicVSR/bear.jpeg']]
gr.Interface(inference,gr.inputs.Image(type="pil",shape=(256,256)),gr.outputs.Image(type="file"),title=title,description=description,article=article,examples=examples).launch(enable_queue=True)