          if image is None:
              logger.trace("_extract_face called without a loaded image. Returning empty face.")
              return None
  
          if self._is_aligned and self._centering != "head":  # Crop out the sub face from full head
              image = self._convert_centering(image)
  
          if self._is_aligned and image.shape[0] != self._size:  # Resize the given aligned face
              interp = cv2.INTER_CUBIC if image.shape[0] < self._size else cv2.INTER_AREA
              retval = cv2.resize(image, (self._size, self._size), interpolation=interp)
 
</s> remove             logger.trace("_extract_face called without a loaded image. Returning empty face.")
 </s> add             logger.trace("_extract_face called without a loaded image. "  # type: ignore
                         "Returning empty face.") </s> remove         # Input image is sized up because of integer rounding
        logger.trace("head_size: %s, image_size: %s, target_size: %s",
                     self._head_size, image.shape[0], self.size)
        if self._head_size != image.shape[0]:
            interp = cv2.INTER_CUBIC if image.shape[0] < self._head_size else cv2.INTER_AREA
            image = cv2.resize(image, (self._head_size, self._head_size), interpolation=interp)

        out = np.zeros((self.size, self.size, image.shape[-1]), dtype=image.dtype)
        slices = self._get_cropped_slices()
 </s> add         logger.trace("image_size: %s, target_size: %s, coverage_ratio: %s",  # type: ignore
                     image.shape[0], self.size, self._coverage_ratio)

        img_size = image.shape[0]
        target_size = get_centered_size(self._source_centering,
                                        self._centering,
                                        img_size,
                                        self._coverage_ratio)
        out = np.zeros((target_size, target_size, image.shape[-1]), dtype=image.dtype)

        slices = self._get_cropped_slices(img_size, target_size) </s> remove     def _convert_centering(self, image):
 </s> add     def _convert_centering(self, image: np.ndarray) -> np.ndarray: </s> remove     def __init__(self, landmarks, image=None, centering="face", size=64, coverage_ratio=1.0,
                 dtype=None, is_aligned=False):
        logger.trace("Initializing: %s (image shape: %s, centering: '%s', size: %s, "
                     "coverage_ratio: %s, dtype: %s, is_aligned: %s)", self.__class__.__name__,
                     image if image is None else image.shape, centering, size, coverage_ratio,
                     dtype, is_aligned)
 </s> add     def __init__(self,
                 landmarks: np.ndarray,
                 image: Optional[np.ndarray] = None,
                 centering: CenteringType = "face",
                 size: int = 64,
                 coverage_ratio: float = 1.0,
                 dtype: Optional[str] = None,
                 is_aligned: bool = False,
                 is_legacy: bool = False) -> None:
        logger.trace("Initializing: %s (image shape: %s, centering: '%s', "  # type: ignore
                     "size: %s, coverage_ratio: %s, dtype: %s, is_aligned: %s, is_legacy: %s)",
                     self.__class__.__name__, image if image is None else image.shape,
                     centering, size, coverage_ratio, dtype, is_aligned, is_legacy) </s> remove         logger.trace("invert: %s, Original points: %s, transformed points: %s",
 </s> add         logger.trace("invert: %s, Original points: %s, transformed points: %s",  # type: ignore
        if self._is_aligned and (self._centering != self._source_centering or
                                 self._coverage_ratio != 1.0):
            # Crop out the sub face from full head
          if image is None:
              logger.trace("_extract_face called without a loaded image. Returning empty face.")
              return None
  
        if self._is_aligned and (self._centering != self._source_centering or
                                 self._coverage_ratio != 1.0):
            # Crop out the sub face from full head
              image = self._convert_centering(image)
  
          if self._is_aligned and image.shape[0] != self._size:  # Resize the given aligned face
              interp = cv2.INTER_CUBIC if image.shape[0] < self._size else cv2.INTER_AREA
              retval = cv2.resize(image, (self._size, self._size), interpolation=interp)
keep keep keep keep replace keep keep keep keep keep
 lib.align.aligned_face updates
  - Typing
  - Legacy support for pre-aligned faces
  - Coverage support for pre-aligned faces
  - Standardized retrieval of sub-crops 
lib/align/aligned_face.py