Skip to content

Instantly share code, notes, and snippets.

@kaushil24
Created December 3, 2019 16:28
Show Gist options
  • Save kaushil24/c4686330464f4aa543dc1d44b279e2fd to your computer and use it in GitHub Desktop.
Save kaushil24/c4686330464f4aa543dc1d44b279e2fd to your computer and use it in GitHub Desktop.
def getEyeLandmarkPts(face_landmark_points):
'''
Input: Coordinates of Bounding Box single face
Returns: eye's landmark points
'''
face_landmark_points[36][0]-=5
face_landmark_points[39][0]+=5
face_landmark_points[42][0]-=5
face_landmark_points[45][0]+=5
L_eye_top = face_landmark_points[36: 40]
L_eye_bottom = np.append(face_landmark_points[39: 42], face_landmark_points[36]).reshape(4,2)
R_eye_top = face_landmark_points[42: 46]
R_eye_bottom = np.append(face_landmark_points[45:48], face_landmark_points[42]).reshape(4,2)
return [L_eye_top, L_eye_bottom, R_eye_top, R_eye_bottom]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment