          cv2.fillConvexPoly(mask, mouth_hull, (1, 1, 1))
  
          if dilation > 0:
              kernel = np.ones((dilation, dilation), np.uint8)
              mask = cv2.dilate(mask, kernel, iterations=1)
  
          logger.trace("Returning: %s", mask)
          return mask
  
  
 
</s> remove         cv2.fillConvexPoly(mask, l_eye_hull, (1, 1, 1))
        cv2.fillConvexPoly(mask, r_eye_hull, (1, 1, 1))
        cv2.fillConvexPoly(mask, mouth_hull, (1, 1, 1))
 </s> add         cv2.fillConvexPoly(mask,  # pylint: disable=no-member
                           l_eye_hull, (1, 1, 1))
        cv2.fillConvexPoly(mask,  # pylint: disable=no-member
                           r_eye_hull, (1, 1, 1))
        cv2.fillConvexPoly(mask,  # pylint: disable=no-member
                           mouth_hull, (1, 1, 1))
 </s> remove 
        (l_start, l_end) = FACIAL_LANDMARKS_IDXS["left_eye"]
        (r_start, r_end) = FACIAL_LANDMARKS_IDXS["right_eye"]
        (m_start, m_end) = FACIAL_LANDMARKS_IDXS["mouth"]
        (n_start, n_end) = FACIAL_LANDMARKS_IDXS["nose"]
        (lb_start, lb_end) = FACIAL_LANDMARKS_IDXS["left_eyebrow"]
        (rb_start, rb_end) = FACIAL_LANDMARKS_IDXS["right_eyebrow"]
        (c_start, c_end) = FACIAL_LANDMARKS_IDXS["chin"]

        l_eye_points = aligned_landmarks_68[l_start:l_end].tolist()
        l_brow_points = aligned_landmarks_68[lb_start:lb_end].tolist()
        r_eye_points = aligned_landmarks_68[r_start:r_end].tolist()
        r_brow_points = aligned_landmarks_68[rb_start:rb_end].tolist()
        nose_points = aligned_landmarks_68[n_start:n_end].tolist()
        chin_points = aligned_landmarks_68[c_start:c_end].tolist()
        mouth_points = aligned_landmarks_68[m_start:m_end].tolist()
        l_eye_points = l_eye_points + l_brow_points
        r_eye_points = r_eye_points + r_brow_points
        mouth_points = mouth_points + nose_points + chin_points

        l_eye_hull = cv2.convexHull(np.array(l_eye_points).reshape(
            (-1, 2)).astype(int)).flatten().reshape((-1, 2))
        r_eye_hull = cv2.convexHull(np.array(r_eye_points).reshape(
            (-1, 2)).astype(int)).flatten().reshape((-1, 2))
        mouth_hull = cv2.convexHull(np.array(mouth_points).reshape(
            (-1, 2)).astype(int)).flatten().reshape((-1, 2))
 </s> add         l_eye_points = aligned_landmarks_68[42:48].tolist()
        l_brow_points = aligned_landmarks_68[22:27].tolist()
        r_eye_points = aligned_landmarks_68[36:42].tolist()
        r_brow_points = aligned_landmarks_68[17:22].tolist()
        nose_points = aligned_landmarks_68[27:36].tolist()
        chin_points = aligned_landmarks_68[8:11].tolist()
        mouth_points = aligned_landmarks_68[48:68].tolist()
        # TODO remove excessive reshapes and flattens

        l_eye = np.array(l_eye_points + l_brow_points).reshape((-1, 2)).astype(int).flatten()
        r_eye = np.array(r_eye_points + r_brow_points).reshape((-1, 2)).astype(int).flatten()
        mouth = np.array(mouth_points + nose_points + chin_points)
        mouth = mouth.reshape((-1, 2)).astype(int).flatten()
        l_eye_hull = cv2.convexHull(l_eye.reshape((-1, 2)))  # pylint: disable=no-member
        r_eye_hull = cv2.convexHull(r_eye.reshape((-1, 2)))  # pylint: disable=no-member
        mouth_hull = cv2.convexHull(mouth.reshape((-1, 2)))  # pylint: disable=no-member
 </s> remove     def get_feature_mask(aligned_landmarks_68, size,
                         padding=0, dilation=30):
 </s> add     def get_feature_mask(aligned_landmarks_68, size, padding=0, dilation=30):
 </s> remove             logger.verbose("No faces were detected in image: %s",
                           os.path.basename(filename))
 </s> add             logger.verbose("No faces were detected in image: %s", os.path.basename(filename)) </s> remove         points = np.array([[0, 0],
                           [0, size - 1],
                           [size - 1, size - 1],
                           [size - 1, 0]], np.int32)
 </s> add         points = np.array([[0, 0], [0, size - 1], [size - 1, size - 1], [size - 1, 0]], np.int32)

            mask = cv2.dilate(mask,  # pylint: disable=no-member
                              kernel, iterations=1)

          cv2.fillConvexPoly(mask, mouth_hull, (1, 1, 1))
  
          if dilation > 0:
              kernel = np.ones((dilation, dilation), np.uint8)
            mask = cv2.dilate(mask,  # pylint: disable=no-member
                              kernel, iterations=1)
  
          logger.trace("Returning: %s", mask)
          return mask
  
  
keep keep keep keep replace keep keep keep keep keep
 Align eyes deprecation (#851)

* align eyes removal

* add align_eyes tool 
lib/aligner.py