shape_predictor_68_face_landmarks.dat deserialization error #2888
Unanswered
jameswhite0811
asked this question in
Q&A
Replies: 1 comment
-
I think you want to perform landmarks detection, then follow this example |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm getting a runtime error that says
RuntimeError: An error occurred while trying to read the first object from the file 'datFiles/shape_predictor_68_face_landmarks.dat'. ERROR: Error deserializing object of type unsigned long while deserializing object of type std::string
. I've researched for quite some time now, and a few people have said they solved it, but didn't post their solutions. Here is my code for reference: `import cv2import dlib
import numpy as np
Load the test image
image = cv2.imread('testPics/group.jpg')
Convert to grayscale
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
Load the face cascade for detection
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
Load the pre-trained face recognition model
face_rec_model = dlib.face_recognition_model_v1("datFiles/shape_predictor_68_face_landmarks.dat")`
Beta Was this translation helpful? Give feedback.
All reactions