Skip to content

Commit

Permalink
Merge pull request #864 from haddyadnan/face-confidence
Browse files Browse the repository at this point in the history
Include detected face confidence
  • Loading branch information
serengil authored Oct 18, 2023
2 parents fb8924e + 0a389de commit 3e1f48c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deepface/DeepFace.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def analyze(
{
"region": {'x': 230, 'y': 120, 'w': 36, 'h': 45},
"age": 28.66,
'face_confidence': 0.9993908405303955,
"dominant_gender": "Woman",
"gender": {
'Woman': 99.99407529830933,
Expand Down Expand Up @@ -335,7 +336,7 @@ def analyze(
align=align,
)

for img_content, img_region, _ in img_objs:
for img_content, img_region, img_confidence in img_objs:
if img_content.shape[0] > 0 and img_content.shape[1] > 0:
obj = {}
# facial attribute analysis
Expand Down Expand Up @@ -390,6 +391,8 @@ def analyze(
# -----------------------------
# mention facial areas
obj["region"] = img_region
# include image confidence
obj["face_confidence"] = img_confidence

resp_objects.append(obj)

Expand Down

0 comments on commit 3e1f48c

Please sign in to comment.