简体   繁体   中英

Dlib face_recognition error from dlib.image_window

I installed dlib using conda, and am using dlib 19.4. When I run the example python code face_recognition.py I get this output error

python face_recognition.py ../models/shape_predictor_5_face_landmarks.dat ../models/dlib_face_recognition_resnet_model_v1.dat ../examples/faces Processing file: D:\\Docs\\Python_code\\Dlib\\examples\\faces\\2007_007763.jpg Number of faces detected: 7 Detection 0: Left: 93 Top: 194 Right: 129 Bottom: 230 Traceback (most recent call last): File "face_recognition.py", line 99, in win.add_overlay(shape) RuntimeError:

Error detected at line 25. Error detected in file C:\\bld\\dlib_1504195460225\\work\\dlib-19.4\\dlib..\\dlib/image_processing/render_face_detections.h. Error detected in function class std::vector > __cdecl dlib::render_face_detections(const class std::vector > &,const struct dlib::rgb_pixel).

Failing expression was dets[i].num_parts() == 68. std::vector render_face_detections() Invalid inputs were given to this function. dets[0].num_parts(): 5

As you can see it does detect 7 faces, which is correct in the image but when it tries to draw the rectangle it runs into the error. I see the error is from the win.add_overlay function. I am lost on this error or how to fix it, any suggestions? The example code is exactly as is from https://github.com/davisking/dlib/blob/master/python_examples/face_recognition.py The window pops up with the image with one red box around a correctly identified face, but only 1 of the 7

If you want to use an example program from the new version of dlib then you need to use the new version of dlib, not an older version. You can't just take an example program for the new version and expect it to run with the old version . The new version has new features, which are illustrated in the example program.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM