AItool commited on
Commit
80af604
·
verified ·
1 Parent(s): 92587e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -16,7 +16,7 @@ TMP_PREFIX = "/tmp/gradio/"
16
  TARGET_DIR = f"{TMP_PREFIX}output/"
17
  EXTENSION = "gif"
18
 
19
- def enhance_image(img_a_path: str, img_b_path: str) -> Tuple[str, str]:
20
  """
21
  3-step pipeline:
22
  1) inference_img.py --img <A> <B> --exp=4 -> writes frames as /tmp/gradio/output/img%d.png
@@ -67,7 +67,7 @@ with gr.Blocks(title="RIFE Interpolation") as demo:
67
  gr.Markdown("### Demo: Preloaded images")
68
  input_imageA = gr.Image(type="filepath", value=str(FRAME1), label="Image A")
69
  input_imageB = gr.Image(type="filepath", value=str(FRAME2), label="Image B")
70
- output_image = gr.Imagee(type="filpath", valuee=str(DEMO), label="Demo")
71
  g_btn = gr.Button("Interpolate")
72
 
73
  output_image = gr.Image(type="filepath", label="Interpolated GIF")
@@ -75,8 +75,8 @@ with gr.Blocks(title="RIFE Interpolation") as demo:
75
 
76
  g_btn.click(
77
  fn=enhance_image,
78
- inputs=[input_imageA, input_imageB, enhance_mode],
79
- outputs=[output_image, enhance_image_path],
80
  )
81
 
82
  with gr.Tab("Upload your images"):
@@ -88,9 +88,9 @@ with gr.Blocks(title="RIFE Interpolation") as demo:
88
  user_out = gr.Image(type="filepath", label="Interpolated GIF")
89
  user_path = gr.Textbox(label="Output path", interactive=False)
90
  user_btn.click(
91
- fn=enhance_image,
92
  inputs=[user_A, user_B],
93
  outputs=[user_out, user_path],
94
  )
95
 
96
- demo.launch()
 
16
  TARGET_DIR = f"{TMP_PREFIX}output/"
17
  EXTENSION = "gif"
18
 
19
+ def interpolate_image(img_a_path: str, img_b_path: str) -> Tuple[str, str]:
20
  """
21
  3-step pipeline:
22
  1) inference_img.py --img <A> <B> --exp=4 -> writes frames as /tmp/gradio/output/img%d.png
 
67
  gr.Markdown("### Demo: Preloaded images")
68
  input_imageA = gr.Image(type="filepath", value=str(FRAME1), label="Image A")
69
  input_imageB = gr.Image(type="filepath", value=str(FRAME2), label="Image B")
70
+ output_image = gr.Image(type="filepath", valuee=str(DEMO), label="Demo")
71
  g_btn = gr.Button("Interpolate")
72
 
73
  output_image = gr.Image(type="filepath", label="Interpolated GIF")
 
75
 
76
  g_btn.click(
77
  fn=enhance_image,
78
+ inputs=[input_imageA, input_imageB],
79
+ outputs=[output_image, DEMO],
80
  )
81
 
82
  with gr.Tab("Upload your images"):
 
88
  user_out = gr.Image(type="filepath", label="Interpolated GIF")
89
  user_path = gr.Textbox(label="Output path", interactive=False)
90
  user_btn.click(
91
+ fn=interpolate_image,
92
  inputs=[user_A, user_B],
93
  outputs=[user_out, user_path],
94
  )
95
 
96
+ app.launch()