AItool commited on
Commit
a52af5f
·
verified ·
1 Parent(s): e7cfbe4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -15,7 +15,7 @@ MODEL = Path("train_log/")
15
 
16
  TMP_PREFIX = "/tmp/gradio/"
17
  TARGET_DIR = f"{TMP_PREFIX}output/"
18
- EXTENSION = "png"
19
 
20
  def interpolate_image(img_a_path: str, img_b_path: str) -> Tuple[str, str]:
21
  """
@@ -44,6 +44,7 @@ def interpolate_image(img_a_path: str, img_b_path: str) -> Tuple[str, str]:
44
  "--exp", "4"
45
  ], check=True)
46
 
 
47
  # 2) Generate palette
48
  subprocess.run([
49
  "ffmpeg", "-y", "-r", "14", "-f", "image2",
@@ -85,15 +86,14 @@ with gr.Blocks(title="RIFE Interpolation") as demo:
85
 
86
  with gr.Tab("Upload your images"):
87
  gr.Markdown("### Upload any two images")
88
- user_A = gr.Image(type="filepath", label="Image A")
89
- user_B = gr.Image(type="filepath", label="Image B")
90
- user_mode = gr.Dropdown(choices=["default"], value="default", label="Mode")
91
  user_btn = gr.Button("Interpolate")
92
- user_out = gr.Image(type="filepath", label="Interpolated GIF")
93
- user_path = gr.Textbox(label="Output path", interactive=False)
94
  user_btn.click(
95
  fn=interpolate_image,
96
- inputs=[user_A, user_B],
97
  outputs=[user_out, user_path],
98
  )
99
 
 
15
 
16
  TMP_PREFIX = "/tmp/gradio/"
17
  TARGET_DIR = f"{TMP_PREFIX}output/"
18
+ EXTENSION = "gif"
19
 
20
  def interpolate_image(img_a_path: str, img_b_path: str) -> Tuple[str, str]:
21
  """
 
44
  "--exp", "4"
45
  ], check=True)
46
 
47
+ print("ok")
48
  # 2) Generate palette
49
  subprocess.run([
50
  "ffmpeg", "-y", "-r", "14", "-f", "image2",
 
86
 
87
  with gr.Tab("Upload your images"):
88
  gr.Markdown("### Upload any two images")
89
+ input_imageA = gr.Image(type="filepath", label="Image A")
90
+ input_imageB = gr.Image(type="filepath", label="Image B")
 
91
  user_btn = gr.Button("Interpolate")
92
+ user_out = gr.Image(type="filepath", value=str(TARGET_DIR), label="Interpolated GIF", value=str(DEMO))
93
+ user_path = gr.Textbox(label="Output path", value=str(TARGET_DIR), interactive=False)
94
  user_btn.click(
95
  fn=interpolate_image,
96
+ inputs=[input_imageA, input_imageB],
97
  outputs=[user_out, user_path],
98
  )
99