app.py: Fixing bug when num_samples is not define in example
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ def to_numpy(img_tensor):
|
|
| 26 |
img_np = np.clip(img_np, 0, 1)
|
| 27 |
return (img_np * 255).astype(np.uint8)
|
| 28 |
|
| 29 |
-
def interpolate(img0_pil, img2_pil, tau, num_samples):
|
| 30 |
img0 = transform(img0_pil.convert("RGB")).unsqueeze(0).to(device)
|
| 31 |
img2 = transform(img2_pil.convert("RGB")).unsqueeze(0).to(device)
|
| 32 |
|
|
@@ -70,10 +70,9 @@ demo = gr.Interface(
|
|
| 70 |
"- If `Number of Samples` > 1, ignores Tau and generates a sequence of interpolated images."
|
| 71 |
),
|
| 72 |
examples=[
|
| 73 |
-
["_data/example_images/frame1.png", "_data/example_images/frame3.png", 0.5],
|
| 74 |
-
]
|
| 75 |
)
|
| 76 |
|
| 77 |
if __name__ == "__main__":
|
| 78 |
-
demo.
|
| 79 |
-
demo.launch(max_threads=1)
|
|
|
|
| 26 |
img_np = np.clip(img_np, 0, 1)
|
| 27 |
return (img_np * 255).astype(np.uint8)
|
| 28 |
|
| 29 |
+
def interpolate(img0_pil, img2_pil, tau=0.5, num_samples=1):
|
| 30 |
img0 = transform(img0_pil.convert("RGB")).unsqueeze(0).to(device)
|
| 31 |
img2 = transform(img2_pil.convert("RGB")).unsqueeze(0).to(device)
|
| 32 |
|
|
|
|
| 70 |
"- If `Number of Samples` > 1, ignores Tau and generates a sequence of interpolated images."
|
| 71 |
),
|
| 72 |
examples=[
|
| 73 |
+
["_data/example_images/frame1.png", "_data/example_images/frame3.png", 0.5, 1],
|
| 74 |
+
]
|
| 75 |
)
|
| 76 |
|
| 77 |
if __name__ == "__main__":
|
| 78 |
+
demo.launch()
|
|
|