mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 20:15:21 +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)
|
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)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user