Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -64,13 +64,13 @@ def create_trajectory_gif(k1=3, k2=20, p=0.1, u1=1, u2=2, u3=2.3, timesteps=6, g
|
|
64 |
plt.tight_layout()
|
65 |
|
66 |
# Save the current frame to a file and add to the list of frames
|
67 |
-
filename = f"
|
68 |
plt.savefig(filename)
|
69 |
frames.append(Image.open(filename))
|
70 |
plt.close()
|
71 |
|
72 |
# Save frames as a GIF
|
73 |
-
gif_filename = '
|
74 |
frames[0].save(gif_filename, save_all=True, append_images=frames[1:], loop=0, duration=100)
|
75 |
|
76 |
# Cleanup temporary frame files
|
|
|
64 |
plt.tight_layout()
|
65 |
|
66 |
# Save the current frame to a file and add to the list of frames
|
67 |
+
filename = f"./static/temp/temp_frame_{int(t_val*10):04d}.png"
|
68 |
plt.savefig(filename)
|
69 |
frames.append(Image.open(filename))
|
70 |
plt.close()
|
71 |
|
72 |
# Save frames as a GIF
|
73 |
+
gif_filename = './static/trajectory_animation2.gif'
|
74 |
frames[0].save(gif_filename, save_all=True, append_images=frames[1:], loop=0, duration=100)
|
75 |
|
76 |
# Cleanup temporary frame files
|