File size: 2,204 Bytes
d761518
b3081cb
9bdccea
b3081cb
3285669
9bdccea
3285669
 
d761518
3285669
9bdccea
9d7aa3b
3285669
 
7e35c85
a13f788
15f5086
a13f788
3285669
 
479ad59
5575b8f
3285669
479ad59
3285669
 
9bdccea
3285669
 
 
7e35c85
a13f788
15f5086
a13f788
3285669
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import gradio as gr

from infer import infer_image, infer_video

input_image = gr.Image(type='pil', label='Input Image')
input_model_image = gr.Radio([('x2', 2), ('x4', 4), ('x8', 8)], type="value", value=4, label="Model Upscale/Enhance Type")
submit_image_button = gr.Button('Submit')
output_image = gr.Image(type="filepath", label="Output Image")

tab_img = gr.Interface(
    fn=infer_image,
    inputs=[input_image, input_model_image],
    outputs=output_image,
    title="Real-ESRGAN Pytorch",
    description="Gradio UI for Real-ESRGAN Pytorch version. To use it, simply upload your image, or click one of examples and choose the model. Read more at the links below. Please click submit only once <br>Credits: [Nick088](https://linktr.ee/Nick088), Xinntao, Tencent, Geeve George, ai-forever, daroche <br><p style='text-align: center'><a href='https://arxiv.org/abs/2107.10833'>Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data</a> | <a href='https://github.com/ai-forever/Real-ESRGAN'>Github Repo</a></p>",
    examples=[
        ["test 1900.jpg", "4"]
    ]
)

input_video = gr.Video(label='Input Video')
input_model_video = gr.Radio([('x2', 2), ('x4', 4), ('x8', 8)], type="value", value=2, label="Model Upscale/Enhance Type")
submit_video_button = gr.Button('Submit')
output_video = gr.Video(label='Output Video')

tab_vid = gr.Interface(
    fn=infer_video,
    inputs=[input_video, input_model_video],
    outputs=output_video,
    title="Real-ESRGAN Pytorch",
    description="Gradio UI for Real-ESRGAN Pytorch version. To use it, simply upload your video, or click one of examples and choose the model. Read more at the links below. Please click submit only once <br>Credits: [Nick088](https://linktr.ee/Nick088), Xinntao, Tencent, Geeve George, ai-forever, daroche <br><p style='text-align: center'><a href='https://arxiv.org/abs/2107.10833'>Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data</a> | <a href='https://github.com/ai-forever/Real-ESRGAN'>Github Repo</a></p>",
    examples=[
        ["1900.mp4", "2"]
    ]
)

demo = gr.TabbedInterface([tab_img, tab_vid], ["Image", "Video"])

demo.launch(debug=True, show_error=True)