Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,23 +18,19 @@ interface = gr.Interface(
|
|
| 18 |
)
|
| 19 |
|
| 20 |
@spaces.GPU(duration=200)
|
| 21 |
-
def generate_video(
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
video.append(Image.fromarray(frame.detach().cpu().numpy()))
|
| 35 |
-
|
| 36 |
-
# Return the generated video
|
| 37 |
-
return video
|
| 38 |
|
| 39 |
# Launch the Gradio app
|
| 40 |
interface.launch()
|
|
|
|
| 18 |
)
|
| 19 |
|
| 20 |
@spaces.GPU(duration=200)
|
| 21 |
+
def generate_video(image):
|
| 22 |
+
"""
|
| 23 |
+
Generates a video from an input image using the pipeline.
|
| 24 |
+
|
| 25 |
+
Args:
|
| 26 |
+
image: A PIL Image object representing the input image.
|
| 27 |
+
|
| 28 |
+
Returns:
|
| 29 |
+
A list of PIL Images representing the video frames.
|
| 30 |
+
"""
|
| 31 |
+
video_frames = pipeline(image=image).images
|
| 32 |
+
|
| 33 |
+
return video_frames
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
# Launch the Gradio app
|
| 36 |
interface.launch()
|