mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
clean code for pre-built models
This commit is contained in:
parent
1d825afbdb
commit
c34f721085
@ -172,12 +172,10 @@ for model_name in models:
|
||||
DeepFace.verify("img1.jpg", "img2.jpg", model_name = model_name, model = model)
|
||||
|
||||
#facial analysis
|
||||
import json
|
||||
models = {}
|
||||
models["emotion"] = DeepFace.build_model('Emotion')
|
||||
models["age"] = DeepFace.build_model('Age')
|
||||
models["gender"] = DeepFace.build_model('Gender')
|
||||
models["race"] = DeepFace.build_model('Race')
|
||||
actions = ['Age', 'Gender', 'Emotion', 'Race']
|
||||
for action in actions:
|
||||
models[action.lower()] = DeepFace.build_model(action)
|
||||
DeepFace.analyze("img1.jpg", models=models)
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user