Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -101,15 +101,15 @@ def fourier_transform_drawing(input_image, frames, coefficients, img_size, blur_
|
|
101 |
anim = animation.FuncAnimation(fig, animate, frames=frames, interval=5, fargs=(coefs, np.linspace(0, 1, num=frames)))
|
102 |
anim.save(temp_file.name, fps=15)
|
103 |
|
104 |
-
# Read the final GIF
|
105 |
-
with open(temp_file.name, 'rb') as gif_file:
|
106 |
-
|
107 |
|
108 |
# Remove the temporary file
|
109 |
-
os.remove(temp_file.name)
|
110 |
|
111 |
# Yield the final GIF in place of the last frame
|
112 |
-
yield (last_image,
|
113 |
|
114 |
# Gradio interface setup
|
115 |
interface = gr.Interface(
|
|
|
101 |
anim = animation.FuncAnimation(fig, animate, frames=frames, interval=5, fargs=(coefs, np.linspace(0, 1, num=frames)))
|
102 |
anim.save(temp_file.name, fps=15)
|
103 |
|
104 |
+
# # Read the final GIF
|
105 |
+
# with open(temp_file.name, 'rb') as gif_file:
|
106 |
+
# final_gif = np.array(Image.open(io.BytesIO(gif_file.read())))
|
107 |
|
108 |
# Remove the temporary file
|
109 |
+
# os.remove(temp_file.name)
|
110 |
|
111 |
# Yield the final GIF in place of the last frame
|
112 |
+
yield (last_image, temp_file.name)
|
113 |
|
114 |
# Gradio interface setup
|
115 |
interface = gr.Interface(
|