Skip to content

Commit 26b79c2

Browse files
authored
Merge pull request #132 from AzureRubia-Guet/patch-1
Update demo_face_recognization.py
2 parents c8b1a46 + 192b583 commit 26b79c2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

machine_vision/face_recognization/demo_face_recognization.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,9 @@ def set_key_state(*_):
9292
for j in range(len(record_ftrs)):
9393
score = kpu.face_compare(record_ftrs[j], feature)
9494
scores.append(score)
95-
max_score = 0
96-
index = 0
97-
for k in range(len(scores)):
98-
if max_score < scores[k]:
99-
max_score = scores[k]
100-
index = k
95+
else:
96+
max_score = max(scores)
97+
index = scores.index(max_score)
10198
if max_score > ACCURACY:
10299
a = img.draw_string(i.x(), i.y(), ("%s :%2.1f" % (
103100
names[index], max_score)), color=(0, 255, 0), scale=2)

0 commit comments

Comments
 (0)