Skip to content

Commit

Permalink
Update DeepFace.py
Browse files Browse the repository at this point in the history
model type check
  • Loading branch information
serengil authored Dec 18, 2023
1 parent 19f7cf6 commit 0c0dfb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deepface/DeepFace.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@ def represent(
img = functions.normalize_input(img=img, normalization=normalization)

# represent
if "keras" in str(type(model)):
# if "keras" in str(type(model)):
if isinstance(model, Model):
# model.predict causes memory issue when it is called in a for loop
# embedding = model.predict(img, verbose=0)[0].tolist()
embedding = model(img, training=False).numpy()[0].tolist()
Expand Down

0 comments on commit 0c0dfb8

Please sign in to comment.