Skip to content

Commit

Permalink
Merge pull request #132 from AzureRubia-Guet/patch-1
Browse files Browse the repository at this point in the history
Update demo_face_recognization.py
  • Loading branch information
Neutree authored Oct 11, 2023
2 parents c8b1a46 + 192b583 commit 26b79c2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions machine_vision/face_recognization/demo_face_recognization.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,9 @@ def set_key_state(*_):
for j in range(len(record_ftrs)):
score = kpu.face_compare(record_ftrs[j], feature)
scores.append(score)
max_score = 0
index = 0
for k in range(len(scores)):
if max_score < scores[k]:
max_score = scores[k]
index = k
else:
max_score = max(scores)
index = scores.index(max_score)
if max_score > ACCURACY:
a = img.draw_string(i.x(), i.y(), ("%s :%2.1f" % (
names[index], max_score)), color=(0, 255, 0), scale=2)
Expand Down

0 comments on commit 26b79c2

Please sign in to comment.