Skip to content

Instantly share code, notes, and snippets.

@kaushil24
Last active December 3, 2019 16:26
Show Gist options
  • Save kaushil24/d4043b75bdc71d238986d274b749ea81 to your computer and use it in GitHub Desktop.
Save kaushil24/d4043b75bdc71d238986d274b749ea81 to your computer and use it in GitHub Desktop.
Face bounding box
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
@aydinnyunus
Copy link

Hi I'm new on Machine Learning.Please tell me your opinions on my projects.Thank you !.

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