Merge pull request #133 from sugyan/fix-preprocess_face

Fix preprocess_face for age prediction
This commit is contained in:
Sefik Ilkin Serengil 2020-11-26 17:19:37 +03:00 committed by GitHub
commit 5d77c1ceff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -444,7 +444,7 @@ def analyze(img_path, actions = [], models = {}, enforce_detection = True, detec
elif action == 'age':
if img_224 is None:
img_224 = functions.preprocess_face(img_path, target_size = (224, 224), grayscale = False, enforce_detection = enforce_detection) #just emotion model expects grayscale images
img_224 = functions.preprocess_face(img = img_path, target_size = (224, 224), grayscale = False, enforce_detection = enforce_detection, detector_backend = detector_backend) #just emotion model expects grayscale images
#print("age prediction")
age_predictions = age_model.predict(img_224)[0,:]
apparent_age = Age.findApparentAge(age_predictions)