Spaces:
Running
Running
clear any previous output
Browse files
app.py
CHANGED
@@ -34,6 +34,15 @@ def load_description(path: str) -> str:
|
|
34 |
return Path(path).read_text(encoding="utf-8")
|
35 |
|
36 |
def interpolate_image(img_a_path: str, img_b_path: str) -> str:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
subprocess.run([
|
38 |
"python3", "inference_img.py",
|
39 |
"--img", str(img_a_path), str(img_b_path),
|
|
|
34 |
return Path(path).read_text(encoding="utf-8")
|
35 |
|
36 |
def interpolate_image(img_a_path: str, img_b_path: str) -> str:
|
37 |
+
# --- clear any previous output ---
|
38 |
+
if OUTPUT_GIF.exists():
|
39 |
+
OUTPUT_GIF.unlink() # delete old GIF
|
40 |
+
if PALETTE_PNG.exists():
|
41 |
+
PALETTE_PNG.unlink() # delete old palette
|
42 |
+
# optional: clear any old frame PNGs
|
43 |
+
for f in TARGET_DIR.glob("img*.png"):
|
44 |
+
f.unlink()
|
45 |
+
|
46 |
subprocess.run([
|
47 |
"python3", "inference_img.py",
|
48 |
"--img", str(img_a_path), str(img_b_path),
|