Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"RuntimeError: The full_object_detection must use the iBUG 300W 68 point face landmark style." #10

Closed
coneypo opened this issue Apr 26, 2019 · 1 comment

Comments

@coneypo
Copy link
Owner

coneypo commented Apr 26, 2019

Error log:

face_descriptor = facerec.compute_face_descriptor(img_gray, shape)
RuntimeError: The full_object_detection must use the iBUG 300W 68 point face landmark style.

Reason:

Casued by Dlib version

Solution:

Apply this patch: c277dbb
(Replace "shape_predictor_5_face_landmarks.dat" with "shape_predictor_68_face_landmarks.dat" in face_reco.py)

@coneypo
Copy link
Owner Author

coneypo commented Dec 20, 2019

Difference between shape_predictor_5_face_landmarks.dat and shape_predictor_68_face_landmarks.dat:

For 5:

  # This is a 5 point landmarking model which identifies the corners of the eyes and bottom of the nose.
  # It is trained on the dlib 5-point face landmark dataset, which consists of 7198 faces.
  # This model is designed to work well with dlib's HOG face detector and the CNN face detector (the one in mmod_human_face_detector.dat).

  predictor = dlib.shape_predictor("data/data_dlib/shape_predictor_5_face_landmarks.dat")
  shape = predictor(img_rd, faces[i])

For 68:

  # This is trained on the ibug 300-W dataset (https://ibug.doc.ic.ac.uk/resources/facial-point-annotations/)
  # Also note that this model file is designed for use with dlib's HOG face detector.
  # That is, it expects the bounding boxes from the face detector to be aligned a certain way, the way dlib's HOG face detector does it.
  # It won't work as well when used with a face detector that produces differently aligned boxes,
  # such as the CNN based mmod_human_face_detector.dat face detector.

  predictor = dlib.shape_predictor("data/data_dlib/shape_predictor_68_face_landmarks.dat")
  shape = predictor(img_rd, faces[i])

So if it shows the Runtime Error with "The full_object_detection must use the iBUG 300W 68 point face landmark style", we need replace shape_predictor_5_face_landmarks.dat with shape_predictor_68_face_landmarks.dat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant