我得到'Unknown Person'标签,但是硬编码的名称没有出现在人的脸下空白,这是什么问题?

问题描述

用于(顶部,右侧,底部,左侧),zip中的face_encoding(face_locations,face_encodings): matchs = face_recognition.compare_faces(kNown_face_encodings,face_encoding)

# IF NOT MATCH
name = 'UnkNown Person'

# IF MATCH:
if True in matches:
    first_match_index = matches.index(True)
    name = kNown_face_names[first_match_index]


# DRAW Box
draw.rectangle(((left,top),(right,bottom)),outline=(0,0))


# DRAW TEXT AND RECTANGLE
text_width,text_height = draw.textsize(name)
draw.rectangle(((left,bottom - text_height - 10),fill=(0,0),0))


# DRAW TEXT INSIDE RECTANGLE
draw.text((left + 5,bottom - text_height - 5),name,fill=(255,255,255))

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)