Skip to content

Commit

Permalink
Merge pull request #166 from williamfzc/fix-tensorflow-26
Browse files Browse the repository at this point in the history
fix(#164): tensorflow api changed
  • Loading branch information
williamfzc authored Oct 9, 2021
2 parents f522b62 + 243cee5 commit 90987fb
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 90987fb

Please sign in to comment.