raydesoky commited on
Commit
ee3f9ca
·
verified ·
1 Parent(s): a7c8ed3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -21
app.py CHANGED
@@ -1,33 +1,25 @@
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
  )
30
 
31
  demo = gr.TabbedInterface([tab_img, tab_vid], ["Image", "Video"])
32
-
33
- demo.launch(debug=True, show_error=True, share=True)
 
1
  import gradio as gr
 
2
  from infer import infer_image, infer_video
3
 
 
 
 
 
 
4
  tab_img = gr.Interface(
5
  fn=infer_image,
6
+ inputs=[
7
+ gr.Image(type='pil', label='Input Image'),
8
+ gr.Radio([('x2', 2), ('x4', 4), ('x8', 8)], type="value", value=4, label="Scale")
9
+ ],
10
+ outputs=gr.Image(type="pil", label="Output Image"),
11
+ title="Real-ESRGAN Upscaler"
12
  )
13
 
 
 
 
 
 
14
  tab_vid = gr.Interface(
15
  fn=infer_video,
16
+ inputs=[
17
+ gr.Video(label='Input Video'),
18
+ gr.Radio([('x2', 2), ('x4', 4), ('x8', 8)], type="value", value=2, label="Scale")
19
+ ],
20
+ outputs=gr.Video(label='Output Video'),
21
+ title="Real-ESRGAN Upscaler"
22
  )
23
 
24
  demo = gr.TabbedInterface([tab_img, tab_vid], ["Image", "Video"])
25
+ demo.launch()