fix
Browse files
app.py
CHANGED
@@ -84,13 +84,9 @@ def get_top_k(probs, k=5, label_map=CLASSES):
|
|
84 |
return tuple(zip(top_labels, top_probs))
|
85 |
|
86 |
def inferenece(video):
|
87 |
-
init_states = {
|
88 |
-
name: tf.zeros(x['shape'], dtype=x['dtype'])
|
89 |
-
for name, x in runner.get_input_details().items()
|
90 |
-
}
|
91 |
-
del init_states['image']
|
92 |
video = frames_from_video_file(video, 20)
|
93 |
clips = tf.split(video, video.shape[1], axis=1)
|
|
|
94 |
for clip in clips:
|
95 |
# Input shape: [1, 1, 172, 172, 3]
|
96 |
outputs = runner(**states, image=clip)
|
|
|
84 |
return tuple(zip(top_labels, top_probs))
|
85 |
|
86 |
def inferenece(video):
|
|
|
|
|
|
|
|
|
|
|
87 |
video = frames_from_video_file(video, 20)
|
88 |
clips = tf.split(video, video.shape[1], axis=1)
|
89 |
+
states = init_states
|
90 |
for clip in clips:
|
91 |
# Input shape: [1, 1, 172, 172, 3]
|
92 |
outputs = runner(**states, image=clip)
|