我正在试用一个使用Facenet算法的人脸识别程序。一切都很好,很好的识别,但程序得到退出时,我移动我的头快速与这个错误。你知道吗
Traceback (most recent call last):
File "vf.py", line 122, in <module>
if HumanNames[best_class_indices[0]] == H_i:
IndexError: list index out of range
for H_i in HumanNames:
if HumanNames[best_class_indices[0]] == H_i:
result_names = HumanNames[best_class_indices[0]]
cv2.putText(frame, result_names, (text_x, text_y), cv2.FONT_HERSHEY_COMPLEX_SMALL,1, (0, 0, 255), thickness=1, lineType=2)
似乎HumanNames中没有存储任何值,如果是这样的话,那么访问列表中的第一项将抛出一个错误是有意义的。你知道吗
首先,您应该检查人名数组的大小,在调试过程中,添加以下行:
相关问题 更多 >
编程相关推荐