  def get_align_mat(face, size, should_align_eyes):
      """ Return the alignment Matrix """
      logger.trace("size: %s, should_align_eyes: %s", size, should_align_eyes)
      mat_umeyama = umeyama(np.array(face.landmarks_xy[17:]), True)[0:2]
  
      if should_align_eyes is False:
          return mat_umeyama
  
      mat_umeyama = mat_umeyama * size
  
      # Convert to matrix
      landmarks = np.matrix(face.landmarks_xy)
  
      # cv2 expects points to be in the form
      # np.array([ [[x1, y1]], [[x2, y2]], ... ]), we'll expand the dim
      landmarks = np.expand_dims(landmarks, axis=1)
  
      # Align the landmarks using umeyama
      umeyama_landmarks = cv2.transform(  # pylint: disable=no-member
          landmarks,
          mat_umeyama,
          landmarks.shape)
  
      # Determine a rotation matrix to align eyes horizontally
      mat_align_eyes = func_align_eyes(umeyama_landmarks, size)
  
      # Extend the 2x3 transform matrices to 3x3 so we can multiply them
      # and combine them as one
      mat_umeyama = np.matrix(mat_umeyama)
      mat_umeyama.resize((3, 3))
      mat_align_eyes = np.matrix(mat_align_eyes)
      mat_align_eyes.resize((3, 3))
      mat_umeyama[2] = mat_align_eyes[2] = [0, 0, 1]
  
      # Combine the umeyama transform with the extra rotation matrix
      transform_mat = mat_align_eyes * mat_umeyama
  
      # Remove the extra row added, shape needs to be 2x3
      transform_mat = np.delete(transform_mat, 2, 0)
      transform_mat = transform_mat / size
      logger.trace("Returning: %s", transform_mat)
      return transform_mat
 
</s> remove     logger.trace("size: %s, should_align_eyes: %s", size, should_align_eyes)
 </s> add  </s> remove def get_align_mat(face, size, should_align_eyes):
 </s> add def get_align_mat(face):
 </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)
 </s> remove         points = cv2.transform(  # pylint: disable=no-member
            points, matrix, points.shape)
 </s> add         points = cv2.transform(points,  # pylint: disable=no-member
                               matrix, points.shape)

    return mat_umeyama

  def get_align_mat(face, size, should_align_eyes):
      """ Return the alignment Matrix """
      logger.trace("size: %s, should_align_eyes: %s", size, should_align_eyes)
      mat_umeyama = umeyama(np.array(face.landmarks_xy[17:]), True)[0:2]
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama
    return mat_umeyama

keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
 Align eyes deprecation (#851)

* align eyes removal

* add align_eyes tool 
lib/aligner.py