Spaces:
Runtime error
Runtime error
Thomas Chaigneau
commited on
Commit
•
2fb5d8c
1
Parent(s):
57002ee
update app
Browse files- app.py +4 -2
- requirements.txt +1 -0
app.py
CHANGED
@@ -8,6 +8,7 @@ Author:
|
|
8 |
"""
|
9 |
import os
|
10 |
import cv2
|
|
|
11 |
import gradio as gr
|
12 |
import numpy as np
|
13 |
|
@@ -104,7 +105,8 @@ def sequence_prediction(path):
|
|
104 |
|
105 |
def to_gif(images):
|
106 |
converted_images = images.astype(np.uint8)
|
107 |
-
|
|
|
108 |
|
109 |
|
110 |
article = article = "<div style='text-align: center;'><a href='https://github.com/ChainYo' target='_blank'>Space by Thomas Chaigneau</a><br><a href='https://keras.io/examples/vision/video_classification/' target='_blank'>Keras example by Sayak Paul</a></div>"
|
@@ -118,5 +120,5 @@ app = gr.Interface(
|
|
118 |
title="Keras Video Classification CNN-RNN model",
|
119 |
description="Keras Working Group",
|
120 |
article=article,
|
121 |
-
examples=samples
|
122 |
).launch(enable_queue=True)
|
|
|
8 |
"""
|
9 |
import os
|
10 |
import cv2
|
11 |
+
import imageio
|
12 |
import gradio as gr
|
13 |
import numpy as np
|
14 |
|
|
|
105 |
|
106 |
def to_gif(images):
|
107 |
converted_images = images.astype(np.uint8)
|
108 |
+
imageio.mimsave("animation.gif", converted_images, fps=10)
|
109 |
+
return embed.embed_file(converted_images)
|
110 |
|
111 |
|
112 |
article = article = "<div style='text-align: center;'><a href='https://github.com/ChainYo' target='_blank'>Space by Thomas Chaigneau</a><br><a href='https://keras.io/examples/vision/video_classification/' target='_blank'>Keras example by Sayak Paul</a></div>"
|
|
|
120 |
title="Keras Video Classification CNN-RNN model",
|
121 |
description="Keras Working Group",
|
122 |
article=article,
|
123 |
+
# examples=samples
|
124 |
).launch(enable_queue=True)
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
opencv-python-headless
|
2 |
tensorflow
|
3 |
git+https://github.com/tensorflow/docs
|
|
|
|
1 |
opencv-python-headless
|
2 |
tensorflow
|
3 |
git+https://github.com/tensorflow/docs
|
4 |
+
imageio
|