Skip to content

Commit

Permalink
fix(#164): tensorflow api changed
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc authored Sep 24, 2021
1 parent f522b62 commit 243cee5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stagesepx/classifier/keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def predict_with_object(self, frame: np.ndarray) -> str:
frame = cv2.resize(frame, dsize=self.data_size)
frame = np.expand_dims(frame, axis=[0, -1])

return str(self._model.predict_classes(frame)[0])
return str(np.argmax(self._model.predict(frame), axis=1)[0])

def _classify_frame(self, frame: VideoFrame, *_, **__) -> str:
return self.predict_with_object(frame.data)

0 comments on commit 243cee5

Please sign in to comment.