          logger.trace("offset: %s", offset)
          return offset
  
  
  def get_centered_size(source_centering, target_centering, size):
      """ Obtain the size of a cropped face from an aligned image.
  
      Given an image of a certain dimensions, returns the dimensions of the sub-crop within that
      image for the requested centering.
  
      Notes
      -----
      `"legacy"` places the nose in the center of the image (the original method for aligning).
      `"face"` aligns for the nose to be in the center of the face (top to bottom) but the center
      of the skull for left to right. `"head"` places the center in the middle of the skull in 3D
      space.
  
      The ROI in relation to the source image is calculated by rounding the padding of one side
      to the nearest integer then applying this padding to the center of the crop, to ensure that
      any dimensions always have an even number of pixels.
  
      Parameters
      ----------
      source_centering: ["head", "face", "legacy"]
          The centering that the original image is aligned at
      target_centering: ["head", "face", "legacy"]
          The centering that the sub-crop size should be obtained for
      size: int
          The size of the source image to obtain the cropped size for
  
      Returns
      -------
      int
          The pixel size of a sub-crop image from a full head aligned image
      """
      if source_centering == target_centering:
          retval = size
      else:
          src_size = size - (size * _EXTRACT_RATIOS[source_centering])
          retval = 2 * int(np.rint(src_size / (1 - _EXTRACT_RATIOS[target_centering]) / 2))
      logger.trace("source_centering: %s, target_centering: %s, size: %s, crop_size: %s",
                   source_centering, target_centering, size, retval)
      return retval
  
  
  def _umeyama(source, destination, estimate_scale):
      """Estimate N-D similarity transformation with or without scaling.
  
      Imported, and slightly adapted, directly from:
      https://github.com/scikit-image/scikit-image/blob/master/skimage/transform/_geometric.py
 
</s> remove         if centering == self.stored_centering:
 </s> add         if centering == self.stored_centering and coverage_ratio == 1.0: </s> remove         offset: :class:`numpy.ndarray`
            The (x, y) offset from the center point to return the mask for
        centering: str
 </s> add         source_offset: :class:`numpy.ndarray`
            The (x, y) offset for the mask at its stored centering
        target_offset: :class:`numpy.ndarray`
            The (x, y) offset for the mask at the requested target centering
         centering: str </s> remove             mask = np.float32(mask) / 255.
        return mask

    def _crop_to_coverage(self, mask: np.ndarray) -> np.ndarray:
        """ Crop the mask to the correct dimensions based on coverage ratio.

        Parameters
        ----------
        mask: :class:`numpy.ndarray`
            The original mask to be cropped

        Returns
        -------
        :class:`numpy.ndarray`
            The cropped mask
        """
        if self._coverage_ratio == 1.0:
            return mask
        mask_size = mask.shape[0]
        padding = round((mask_size * (1 - self._coverage_ratio)) / 2)
        mask_slice = slice(padding, mask_size - padding)
        mask = mask[mask_slice, mask_slice, :]
        logger.trace("mask_size: %s, coverage: %s, padding: %s, final shape: %s",  # type: ignore
                     mask_size, self._coverage_ratio, padding, mask.shape)
        return mask
 </s> add             face_mask = face_mask.astype("float32") / 255.
        return face_mask </s> remove         sub_crop_offset: :class:`numpy.ndarray`
            The (x, y) offset to crop the mask from the center point. Set to `None` if the mask
            does not need to be offset for alternative centering
 </s> add         source_offset: :class:`numpy.ndarray`
            The (x, y) offset for the mask at its stored centering
        target_offset: :class:`numpy.ndarray`
            The (x, y) offset for the mask at the requested target centering
          logger.trace("offset: %s", offset)
          return offset
  
  









































  def _umeyama(source, destination, estimate_scale):
      """Estimate N-D similarity transformation with or without scaling.
  
      Imported, and slightly adapted, directly from:
      https://github.com/scikit-image/scikit-image/blob/master/skimage/transform/_geometric.py
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 replace replace replace keep keep keep keep keep
 lib.detected_face.Mask
  - Add source + target offset and coverage to set_sub_crop method 
lib/align/aligned_face.py