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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -10,12 +10,13 @@ import gradio as gr
10
  # Demo images
11
  FRAME1 = Path("demo/frame1.jpg")
12
  FRAME2 = Path("demo/frame2.jpg")
 
13
 
14
  TMP_PREFIX = "/tmp/gradio/"
15
  TARGET_DIR = f"{TMP_PREFIX}output/"
16
  EXTENSION = "gif"
17
 
18
- def enhance_image(img_a_path: str, img_b_path: str, mode: str) -> Tuple[str, str]:
19
  """
20
  3-step pipeline:
21
  1) inference_img.py --img <A> <B> --exp=4 -> writes frames as /tmp/gradio/output/img%d.png
@@ -66,7 +67,7 @@ with gr.Blocks(title="RIFE Interpolation") as demo:
66
  gr.Markdown("### Demo: Preloaded images")
67
  input_imageA = gr.Image(type="filepath", value=str(FRAME1), label="Image A")
68
  input_imageB = gr.Image(type="filepath", value=str(FRAME2), label="Image B")
69
- enhance_mode = gr.Dropdown(choices=["default"], value="default", label="Mode") # placeholder to match signature
70
  g_btn = gr.Button("Interpolate")
71
 
72
  output_image = gr.Image(type="filepath", label="Interpolated GIF")
@@ -88,7 +89,7 @@ with gr.Blocks(title="RIFE Interpolation") as demo:
88
  user_path = gr.Textbox(label="Output path", interactive=False)
89
  user_btn.click(
90
  fn=enhance_image,
91
- inputs=[user_A, user_B, user_mode],
92
  outputs=[user_out, user_path],
93
  )
94
 
 
10
  # Demo images
11
  FRAME1 = Path("demo/frame1.jpg")
12
  FRAME2 = Path("demo/frame2.jpg")
13
+ DEMO = Path("demo/demo.gif")
14
 
15
  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
  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")
 
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