来自dlib.image_window

时间:2017-10-08 21:45:01

标签: python dlib

我使用conda安装了dlib,并且正在使用dlib 19.4。当我运行示例python代码face_recognition.py时,我得到此输出错误

python face_recognition.py ../models/shape_predictor_5_face_landmarks.dat ../models/dlib_face_recognition_resnet_model_v1.dat ../examples/faces 处理文件:D:\ Docs \ Python_code \ Dlib \ examples \ faces \ 2007_007763.jpg 检测到的面部数量:7 检测0:左:93上:194右:129下:230 Traceback(最近一次调用最后一次):   文件“face_recognition.py”,第99行,in     win.add_overlay(形状) RuntimeError:

第25行检测到错误。 在文件C中检测到错误:\ bld \ dlib_1504195460225 \ work \ dlib-19.4 \ dlib .. \ dlib / image_processing / render_face_detections.h。 在函数类std :: vector>中检测到错误__cdecl dlib :: render_face_detections(const class std :: vector>&,const struct dlib :: rgb_pixel)。

表达失败是dets [i] .num_parts()== 68。          std :: vector render_face_detections()          该函数的输入无效。          dets [0] .num_parts():5

正如您所看到的,它确实检测到7个面,这在图像中是正确的,但是当它尝试绘制矩形时会遇到错误。我看到错误来自win.add_overlay函数。我迷失了这个错误或如何解决它,任何建议?示例代码与https://github.com/davisking/dlib/blob/master/python_examples/face_recognition.py完全相同 窗口弹出图像,在正确识别的面部周围有一个红色框,但只有7个

中的一个

1 个答案:

答案 0 :(得分:0)

如果要使用新版dlib中的示例程序,则需要使用新版本的dlib,而不是旧版本。 您不能仅为新版本采用示例程序,并希望它与旧版本一起运行。新版本具有新功能,示例程序中对此进行了说明。