From bafd1020f3eb87af88e89b91071663fecd75aaa2 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Tue, 11 Feb 2020 10:31:57 +0300 Subject: [PATCH] verify function detail --- README.md | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/README.md b/README.md index 5985cb3..0b4f425 100644 --- a/README.md +++ b/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.