Spaces:
Runtime error
Runtime error
debugging inability to produce correct gif depending on parameters
Browse files- image_posterior.py +3 -3
image_posterior.py
CHANGED
@@ -78,11 +78,11 @@ def create_gif(explanation_blr, img_name, segments, image, n_images=20, n_max=5)
|
|
78 |
# https://stackoverflow.com/questions/61716066/creating-an-animation-out-of-matplotlib-pngs
|
79 |
print(f"Saving gif to {img_name}_explanation.gif")
|
80 |
|
81 |
-
if(os.path.exists(f'
|
82 |
-
os.remove(f'
|
83 |
|
84 |
ims = [imageio.imread(f) for f in paths]
|
85 |
-
imageio.mimwrite(f'
|
86 |
|
87 |
html = (
|
88 |
"<div >"
|
|
|
78 |
# https://stackoverflow.com/questions/61716066/creating-an-animation-out-of-matplotlib-pngs
|
79 |
print(f"Saving gif to {img_name}_explanation.gif")
|
80 |
|
81 |
+
if(os.path.exists(f'{img_name}_explanation.gif')):
|
82 |
+
os.remove(f'{img_name}_explanation.gif')
|
83 |
|
84 |
ims = [imageio.imread(f) for f in paths]
|
85 |
+
imageio.mimwrite(f'{img_name}_explanation.gif', ims)
|
86 |
|
87 |
html = (
|
88 |
"<div >"
|