Last active
December 3, 2019 16:26
-
-
Save kaushil24/d4043b75bdc71d238986d274b749ea81 to your computer and use it in GitHub Desktop.
Face bounding box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
face_detector = dlib.get_frontal_face_detector() | |
lndMrkDetector = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat") | |
def Eyeliner(frame): | |
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) | |
bounding_boxes = face_detector(gray, 0)# The 2nd argument means that we upscale the image by 'x' number of times to detect more faces. | |
if bounding_boxes: | |
for i, bb in enumerate(bounding_boxes): | |
face_landmark_points = lndMrkDetector(gray, bb) | |
face_landmark_points = face_utils.shape_to_np(face_landmark_points) | |
eye_landmark_points = getEyeLandmarkPts(face_landmark_points) | |
eyeliner_points = getEyelinerPoints(eye_landmark_points) | |
op = drawEyeliner(frame, eyeliner_points) | |
return op |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi I'm new on Machine Learning.Please tell me your opinions on my projects.Thank you !.