Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -84,8 +84,7 @@ def animate(frame, coefs, frame_times, fig, ax, background, circles, circle_line
|
|
84 |
|
85 |
# Convert canvas to PIL Image using buffer_rgba
|
86 |
#fig.canvas.draw()
|
87 |
-
|
88 |
-
pil_image = Image.frombuffer("RGBA", fig.canvas.get_width_height(), buffer, "raw", "RGBA", 0, 1)
|
89 |
|
90 |
return (pil_image, None)
|
91 |
|
@@ -106,7 +105,8 @@ def fourier_transform_drawing(input_image, frames, coefficients, img_size, blur_
|
|
106 |
|
107 |
# Generate and save each frame as a PIL image, and ultimately the video
|
108 |
for frame in range(frames):
|
109 |
-
pil_image, _ = animate(frame, coefs, frame_times, fig, ax, background, circles, circle_lines, drawing, draw_x, draw_y, coefs_static, thetas)
|
|
|
110 |
yield pil_image, video_path
|
111 |
|
112 |
# Save the animation as a video
|
|
|
84 |
|
85 |
# Convert canvas to PIL Image using buffer_rgba
|
86 |
#fig.canvas.draw()
|
87 |
+
pil_image = Image.frombuffer("RGBA", fig.canvas.get_width_height(), fig.canvas.buffer_rgba(), "raw", "RGBA", 0, 1)
|
|
|
88 |
|
89 |
return (pil_image, None)
|
90 |
|
|
|
105 |
|
106 |
# Generate and save each frame as a PIL image, and ultimately the video
|
107 |
for frame in range(frames):
|
108 |
+
#pil_image, _ = animate(frame, coefs, frame_times, fig, ax, background, circles, circle_lines, drawing, draw_x, draw_y, coefs_static, thetas)
|
109 |
+
pil_image = input_image
|
110 |
yield pil_image, video_path
|
111 |
|
112 |
# Save the animation as a video
|