mirror of
https://github.com/serengil/deepface.git
synced 2025-06-05 19:15:23 +00:00
verify function detail
This commit is contained in:
parent
37a427a149
commit
bafd1020f3
13
README.md
13
README.md
@ -48,7 +48,7 @@ result = DeepFace.verify("img1.jpg", "img2.jpg", model_name = "VGG-Face", distan
|
||||
|
||||
## Verification
|
||||
|
||||
Verification function returns a tuple including boolean verification result, distance between two faces and max threshold to identify.
|
||||
Verification function returns a tuple including boolean verification result, distance between two faces and max threshold to identify (this shows difference based on face recognition model and similarity metric).
|
||||
|
||||
```
|
||||
(True, 0.281734, 0.30)
|
||||
@ -62,17 +62,6 @@ found_distance = result[1] #distance of two face vectors
|
||||
max_threshold_to_verify = result[2] #faces have a distance less than this value will be verified
|
||||
```
|
||||
|
||||
Instead of using pre-tuned threshold values, you can alternatively check the distance by yourself.
|
||||
|
||||
```python
|
||||
distance = result[1] #the less the better
|
||||
threshold = 0.30 #threshold for VGG-Face and Cosine Similarity
|
||||
if distance < threshold:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
```
|
||||
|
||||
# Facial Attribute Analysis
|
||||
|
||||
Deepface also offers facial attribute analysis including [`age`](https://sefiks.com/2019/02/13/apparent-age-and-gender-prediction-in-keras/), [`gender`](https://sefiks.com/2019/02/13/apparent-age-and-gender-prediction-in-keras/), [`emotion`](https://sefiks.com/2018/01/01/facial-expression-recognition-with-keras/) and [`race`](https://sefiks.com/2019/11/11/race-and-ethnicity-prediction-in-keras/) predictions. Analysis function under the DeepFace interface is used to find demography of a face.
|
||||
|
Loading…
x
Reference in New Issue
Block a user