Thomas Chaigneau commited on
Commit
57002ee
1 Parent(s): fe1f7ad

add gif to outputs

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -98,7 +98,8 @@ def sequence_prediction(path):
98
  preds = {}
99
  for i in np.argsort(probabilities)[::-1]:
100
  preds[class_vocab[i]] = float(probabilities[i])
101
- return preds
 
102
 
103
 
104
  def to_gif(images):
@@ -110,7 +111,10 @@ article = article = "<div style='text-align: center;'><a href='https://github.co
110
  app = gr.Interface(
111
  sequence_prediction,
112
  inputs=[gr.inputs.Video(label="Video", type="avi")],
113
- outputs=[gr.outputs.Label(label="Prediction", type="confidences")],
 
 
 
114
  title="Keras Video Classification CNN-RNN model",
115
  description="Keras Working Group",
116
  article=article,
 
98
  preds = {}
99
  for i in np.argsort(probabilities)[::-1]:
100
  preds[class_vocab[i]] = float(probabilities[i])
101
+ gif = to_gif(frames)
102
+ return preds, gif
103
 
104
 
105
  def to_gif(images):
 
111
  app = gr.Interface(
112
  sequence_prediction,
113
  inputs=[gr.inputs.Video(label="Video", type="avi")],
114
+ outputs=[
115
+ gr.outputs.Label(label="Prediction", type="confidences"),
116
+ gr.outputs.Image(label="GIF", type="gif"),
117
+ ],
118
  title="Keras Video Classification CNN-RNN model",
119
  description="Keras Working Group",
120
  article=article,