Merge pull request #49 from danielgo13/bugfix/deepface-verify

fix: check first the type of the input_shape before get the shape. Al…
This commit is contained in:
Sefik Ilkin Serengil 2020-06-18 14:43:49 +03:00 committed by GitHub
commit 4b1f7db558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,7 +196,7 @@ def verify(img1_path, img2_path=''
print("Using FB DeepFace model backend", distance_metric,"distance.")
model = FbDeepFace.loadModel()
if model_name == 'DeepID':
elif model_name == 'DeepID':
print("Using DeepID2 model backend", distance_metric,"distance.")
model = DeepID.loadModel()
@ -207,7 +207,10 @@ def verify(img1_path, img2_path=''
#------------------------------
#face recognition models have different size of inputs
input_shape = model.layers[0].input_shape[1:3]
input_shape = model.layers[0].input_shape
if type(input_shape) is list:
input_shape = input_shape[0][1:3]
input_shape_x = input_shape[0]
input_shape_y = input_shape[1]