import os import sys os.system("mim install mmcv-full") 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" gr.Interface(inference,gr.inputs.Image(type="pil"),gr.outputs.Image(type="file")).launch()