clean code for pre-built models

This commit is contained in:
serengil 2020-12-04 16:07:16 +03:00
parent 1d825afbdb
commit c34f721085

View File

@ -172,12 +172,10 @@ for model_name in models:
DeepFace.verify("img1.jpg", "img2.jpg", model_name = model_name, model = model) DeepFace.verify("img1.jpg", "img2.jpg", model_name = model_name, model = model)
#facial analysis #facial analysis
import json
models = {} models = {}
models["emotion"] = DeepFace.build_model('Emotion') actions = ['Age', 'Gender', 'Emotion', 'Race']
models["age"] = DeepFace.build_model('Age') for action in actions:
models["gender"] = DeepFace.build_model('Gender') models[action.lower()] = DeepFace.build_model(action)
models["race"] = DeepFace.build_model('Race')
DeepFace.analyze("img1.jpg", models=models) DeepFace.analyze("img1.jpg", models=models)
``` ```