Spaces:
Running
on
Zero
Running
on
Zero
Comma
Browse files
app.py
CHANGED
|
@@ -1,41 +1,41 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
|
| 3 |
-
from infer import infer_image, infer_video
|
| 4 |
-
|
| 5 |
-
input_image = gr.Image(type='pil', label='Input Image')
|
| 6 |
-
input_model_image = gr.Radio([('x2', 2), ('x4', 4), ('x8', 8)], type="value", value=4, label="Model Upscale/Enhance Type")
|
| 7 |
-
submit_image_button = gr.Button('Submit')
|
| 8 |
-
output_image = gr.Image(type="filepath", label="Output Image")
|
| 9 |
-
|
| 10 |
-
tab_img = gr.Interface(
|
| 11 |
-
fn=infer_image,
|
| 12 |
-
inputs=[input_image, input_model_image],
|
| 13 |
-
outputs=output_image,
|
| 14 |
-
title="Real-ESRGAN Pytorch",
|
| 15 |
-
description="Gradio UI for Real-ESRGAN Pytorch version. To use it, simply upload your image 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://github.com/Nick088/Real-ESRGAN_Pytorch'>Github Repo</a></p>"
|
| 16 |
-
)
|
| 17 |
-
|
| 18 |
-
input_video = gr.Video(label='Input Video')
|
| 19 |
-
input_model_video = gr.Radio([('x2', 2), ('x4', 4), ('x8', 8)], type="value", value=2, label="Model Upscale/Enhance Type")
|
| 20 |
-
submit_video_button = gr.Button('Submit')
|
| 21 |
-
output_video = gr.Video(label='Output Video')
|
| 22 |
-
|
| 23 |
-
tab_vid = gr.Interface(
|
| 24 |
-
fn=infer_video,
|
| 25 |
-
inputs=[input_video, input_model_video],
|
| 26 |
-
outputs=output_video,
|
| 27 |
-
title="Real-ESRGAN Pytorch",
|
| 28 |
-
description="Gradio UI for Real-ESRGAN Pytorch version. To use it, simply upload your video 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>"
|
| 29 |
-
examples=[
|
| 30 |
-
[
|
| 31 |
-
"RealESRGAN_examples/Example1.mp4",
|
| 32 |
-
2
|
| 33 |
-
]
|
| 34 |
-
],
|
| 35 |
-
cache_examples=True,
|
| 36 |
-
cache_mode='lazy',
|
| 37 |
-
)
|
| 38 |
-
|
| 39 |
-
demo = gr.TabbedInterface([tab_img, tab_vid], ["Image", "Video"])
|
| 40 |
-
|
| 41 |
demo.launch(debug=True, show_error=True, share=True)
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
from infer import infer_image, infer_video
|
| 4 |
+
|
| 5 |
+
input_image = gr.Image(type='pil', label='Input Image')
|
| 6 |
+
input_model_image = gr.Radio([('x2', 2), ('x4', 4), ('x8', 8)], type="value", value=4, label="Model Upscale/Enhance Type")
|
| 7 |
+
submit_image_button = gr.Button('Submit')
|
| 8 |
+
output_image = gr.Image(type="filepath", label="Output Image")
|
| 9 |
+
|
| 10 |
+
tab_img = gr.Interface(
|
| 11 |
+
fn=infer_image,
|
| 12 |
+
inputs=[input_image, input_model_image],
|
| 13 |
+
outputs=output_image,
|
| 14 |
+
title="Real-ESRGAN Pytorch",
|
| 15 |
+
description="Gradio UI for Real-ESRGAN Pytorch version. To use it, simply upload your image 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://github.com/Nick088/Real-ESRGAN_Pytorch'>Github Repo</a></p>"
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
input_video = gr.Video(label='Input Video')
|
| 19 |
+
input_model_video = gr.Radio([('x2', 2), ('x4', 4), ('x8', 8)], type="value", value=2, label="Model Upscale/Enhance Type")
|
| 20 |
+
submit_video_button = gr.Button('Submit')
|
| 21 |
+
output_video = gr.Video(label='Output Video')
|
| 22 |
+
|
| 23 |
+
tab_vid = gr.Interface(
|
| 24 |
+
fn=infer_video,
|
| 25 |
+
inputs=[input_video, input_model_video],
|
| 26 |
+
outputs=output_video,
|
| 27 |
+
title="Real-ESRGAN Pytorch",
|
| 28 |
+
description="Gradio UI for Real-ESRGAN Pytorch version. To use it, simply upload your video 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>",
|
| 29 |
+
examples=[
|
| 30 |
+
[
|
| 31 |
+
"RealESRGAN_examples/Example1.mp4",
|
| 32 |
+
2
|
| 33 |
+
]
|
| 34 |
+
],
|
| 35 |
+
cache_examples=True,
|
| 36 |
+
cache_mode='lazy',
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
demo = gr.TabbedInterface([tab_img, tab_vid], ["Image", "Video"])
|
| 40 |
+
|
| 41 |
demo.launch(debug=True, show_error=True, share=True)
|