Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -38,4 +38,28 @@ def interpolate(img_a_path, img_b_path):
|
|
38 |
return str(RESULT_GIF)
|
39 |
|
40 |
except subprocess.CalledProcessError:
|
41 |
-
raise gr.Error("Interpolation failed — check your script
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
return str(RESULT_GIF)
|
39 |
|
40 |
except subprocess.CalledProcessError:
|
41 |
+
raise gr.Error("Interpolation failed — check your script and paths.")
|
42 |
+
|
43 |
+
def reset_demo():
|
44 |
+
"""
|
45 |
+
Return paths to static demo images.
|
46 |
+
"""
|
47 |
+
return str(FRAME1), str(FRAME2)
|
48 |
+
|
49 |
+
# --- Gradio Interface ---
|
50 |
+
with gr.Blocks(title="RIFE Image Interpolation") as demo:
|
51 |
+
with gr.Tab("Demo"):
|
52 |
+
gr.Markdown("### Interpolate between two images → Retro GIF")
|
53 |
+
|
54 |
+
img_a = gr.Image(type="filepath", value=str(FRAME1), label="Image A")
|
55 |
+
img_b = gr.Image(type="filepath", value=str(FRAME2), label="Image B")
|
56 |
+
|
57 |
+
run_btn = gr.Button("Interpolate")
|
58 |
+
reset_btn = gr.Button("Reset")
|
59 |
+
|
60 |
+
result_img = gr.Image(type="filepath", label="Interpolated GIF")
|
61 |
+
|
62 |
+
run_btn.click(interpolate, inputs=[img_a, img_b], outputs=result_img)
|
63 |
+
reset_btn.click(reset_demo, outputs=[img_a, img_b])
|
64 |
+
|
65 |
+
demo.launch()
|