Skip to content

Commit

Permalink
Merge pull request serengil#857 from Villyli/master
Browse files Browse the repository at this point in the history
change model.predict() to model(), notably improve memory leak (issue serengil#697)
  • Loading branch information
serengil committed Oct 22, 2023
2 parents cc5b18e + 1d57b2f commit 68eaafc
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 @@ -696,7 +696,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 68eaafc

Please sign in to comment.