Skip to content

Commit

Permalink
change model.predict() to model(), improve mem leak notably
Browse files Browse the repository at this point in the history
  • Loading branch information
lilw5 committed Oct 10, 2023
1 parent fb8924e commit 1d57b2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepface/DeepFace.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ def represent(
# represent
if "keras" in str(type(model)):
# new tf versions show progress bar and it is annoying
embedding = model.predict(img, verbose=0)[0].tolist()
embedding = model(img, training=False).numpy()[0].tolist()
else:
# SFace and Dlib are not keras models and no verbose arguments
embedding = model.predict(img)[0].tolist()
Expand Down

0 comments on commit 1d57b2f

Please sign in to comment.