Spaces:
Running
Running
Remove Tuple
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ OUTPUT_GIF = Path(TARGET_DIR) / "output.gif"
|
|
14 |
|
15 |
os.makedirs(TARGET_DIR, exist_ok=True)
|
16 |
|
17 |
-
def interpolate_image(img_a_path: str, img_b_path: str) ->
|
18 |
# 1) Run inference to generate frames into TARGET_DIR/img%d.png
|
19 |
subprocess.run([
|
20 |
"python3", "inference_img.py",
|
@@ -40,7 +40,7 @@ def interpolate_image(img_a_path: str, img_b_path: str) -> tuple[str, str]:
|
|
40 |
str(OUTPUT_GIF)
|
41 |
], check=True)
|
42 |
|
43 |
-
return str(OUTPUT_GIF)
|
44 |
|
45 |
with gr.Blocks(title="RIFE Interpolation") as demo:
|
46 |
with gr.Tab("Demo"):
|
@@ -49,8 +49,8 @@ with gr.Blocks(title="RIFE Interpolation") as demo:
|
|
49 |
input_imageB = gr.Image(type="filepath", value=str(FRAME2), label="Image B")
|
50 |
run_btn = gr.Button("Interpolate")
|
51 |
result_img = gr.Image(type="filepath", label="Interpolated GIF")
|
52 |
-
#
|
53 |
-
run_btn.click(interpolate_image, [input_imageA, input_imageB], [result_img
|
54 |
|
55 |
with gr.Tab("Upload your images"):
|
56 |
gr.Markdown("### Upload any two images")
|
@@ -58,8 +58,8 @@ with gr.Blocks(title="RIFE Interpolation") as demo:
|
|
58 |
user_B = gr.Image(type="filepath", label="Image B")
|
59 |
run_btn2 = gr.Button("Interpolate")
|
60 |
user_img = gr.Image(type="filepath", label="Interpolated GIF")
|
61 |
-
#
|
62 |
-
run_btn2.click(interpolate_image, [user_A, user_B], [user_img
|
63 |
gr.HTML("""<div style="margin: 0.75em 0;"><a href="https://www.buymeacoffee.com/Artgen" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a></div>
|
64 |
<div style="margin: 0.75em 0;">But what would really help me is a <strong>PRO subscription</strong> to Google Colab, Kaggle or Hugging Face. Many thanks.</div>""")
|
65 |
|
|
|
14 |
|
15 |
os.makedirs(TARGET_DIR, exist_ok=True)
|
16 |
|
17 |
+
def interpolate_image(img_a_path: str, img_b_path: str) -> str:
|
18 |
# 1) Run inference to generate frames into TARGET_DIR/img%d.png
|
19 |
subprocess.run([
|
20 |
"python3", "inference_img.py",
|
|
|
40 |
str(OUTPUT_GIF)
|
41 |
], check=True)
|
42 |
|
43 |
+
return str(OUTPUT_GIF)
|
44 |
|
45 |
with gr.Blocks(title="RIFE Interpolation") as demo:
|
46 |
with gr.Tab("Demo"):
|
|
|
49 |
input_imageB = gr.Image(type="filepath", value=str(FRAME2), label="Image B")
|
50 |
run_btn = gr.Button("Interpolate")
|
51 |
result_img = gr.Image(type="filepath", label="Interpolated GIF")
|
52 |
+
#result_path = gr.Textbox(label="Output path", interactive=False)
|
53 |
+
run_btn.click(interpolate_image, [input_imageA, input_imageB], [result_img])
|
54 |
|
55 |
with gr.Tab("Upload your images"):
|
56 |
gr.Markdown("### Upload any two images")
|
|
|
58 |
user_B = gr.Image(type="filepath", label="Image B")
|
59 |
run_btn2 = gr.Button("Interpolate")
|
60 |
user_img = gr.Image(type="filepath", label="Interpolated GIF")
|
61 |
+
#user_path = gr.Textbox(label="Output path", interactive=False)
|
62 |
+
run_btn2.click(interpolate_image, [user_A, user_B], [user_img])
|
63 |
gr.HTML("""<div style="margin: 0.75em 0;"><a href="https://www.buymeacoffee.com/Artgen" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a></div>
|
64 |
<div style="margin: 0.75em 0;">But what would really help me is a <strong>PRO subscription</strong> to Google Colab, Kaggle or Hugging Face. Many thanks.</div>""")
|
65 |
|