We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
hey,
I'm working with python and i use the dlib , opencv library but when i put this cod show me an error, this is a cod that i use:
from imutils import face_utils
import dlib
import cv2
p = "shape_predictor_68_face_landmarks.dat"
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(p)
image = cv2.imread("example.jpg")
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
rects = detector(gray, 0)
for (i, rect) in enumerate(rects):
shape = predictor(gray, rect)
shape = face_utils.shape_to_np(shape)
for (x, y) in shape:
cv2.circle(image, (x, y), 2, (0, 255, 0), -1)
cv2.imshow("Output", image)
cv2.waitKey(0)
e da-me erro quando introduzi
the error is
Unable to open shape_predictor_68_face_landmarks.dat
someone can help me?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
hey,
I'm working with python and i use the dlib , opencv library but when i put this cod show me an error, this is a cod that i use:
import the necessary packages
from imutils import face_utils
import dlib
import cv2
initialize dlib's face detector (HOG-based) and then create
the facial landmark predictor
p = "shape_predictor_68_face_landmarks.dat"
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(p)
load the input image and convert it to grayscale
image = cv2.imread("example.jpg")
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
detect faces in the grayscale image
rects = detector(gray, 0)
loop over the face detections
for (i, rect) in enumerate(rects):
determine the facial landmarks for the face region, then
convert the facial landmark (x, y)-coordinates to a NumPy
array
shape = predictor(gray, rect)
shape = face_utils.shape_to_np(shape)
loop over the (x, y)-coordinates for the facial landmarks
and draw them on the image
for (x, y) in shape:
cv2.circle(image, (x, y), 2, (0, 255, 0), -1)
show the output image with the face detections + facial landmarks
cv2.imshow("Output", image)
cv2.waitKey(0)
e da-me erro quando introduzi
predictor = dlib.shape_predictor(p)
the error is
Unable to open shape_predictor_68_face_landmarks.dat
someone can help me?
The text was updated successfully, but these errors were encountered: