mirror of
https://github.com/serengil/deepface.git
synced 2025-06-13 06:47:11 +00:00
docs for model building
This commit is contained in:
parent
005f3bee31
commit
69acbacf88
16
README.md
16
README.md
@ -160,18 +160,18 @@ You can build models once and pass to deepface functions as well. This speeds yo
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
#face recognition
|
#face recognition
|
||||||
from deepface.basemodels import VGGFace, OpenFace, Facenet, FbDeepFace, DeepID
|
models = ['VGG-Face', 'Facenet', 'OpenFace', 'DeepFace', 'DeepID', 'Dlib']
|
||||||
model = VGGFace.loadModel() #all face recognition models have loadModel() function in their interfaces
|
for model_name in models:
|
||||||
DeepFace.verify("img1.jpg", "img2.jpg", model_name = "VGG-Face", model = model)
|
model = DeepFace.build_model(model_name)
|
||||||
|
DeepFace.verify("img1.jpg", "img2.jpg", model_name = model_name, model = model)
|
||||||
|
|
||||||
#facial analysis
|
#facial analysis
|
||||||
import json
|
import json
|
||||||
from deepface.extendedmodels import Age, Gender, Race, Emotion
|
|
||||||
models = {}
|
models = {}
|
||||||
models["emotion"] = Emotion.loadModel()
|
models["emotion"] = DeepFace.build_model('Emotion')
|
||||||
models["age"] = Age.loadModel()
|
models["age"] = DeepFace.build_model('Age')
|
||||||
models["gender"] = Gender.loadModel()
|
models["gender"] = DeepFace.build_model('Gender')
|
||||||
models["race"] = Race.loadModel()
|
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