              mask = cv2.resize(mask,
                                self._box.shape[:2],
                                interpolation=interp)[..., None].astype("float32") / 255.
          else:
              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
  
      # MASK MANIPULATIONS
      def _erode(self, mask: np.ndarray) -> np.ndarray:
          """ Erode or dilate mask the mask based on configuration options.
  
 
</s> remove             mask = cv2.resize(mask,
                              self._box.shape[:2],
                              interpolation=interp)[..., None].astype("float32") / 255.
 </s> add             face_mask = cv2.resize(face_mask,
                                   self._box.shape[:2],
                                   interpolation=interp)[..., None].astype("float32") / 255. </s> remove             mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)
 </s> add             mask = self._get_stored_mask(detected_face, centering, source_offset, target_offset) </s> remove         logger.trace("mask shape: %s", mask.shape)
 </s> add         logger.trace("mask shape: %s", mask.shape)  # type: ignore </s> remove         if self._sub_crop["size"]:  # Crop the mask to the given centering
            out = np.zeros((self._sub_crop["size"], self._sub_crop["size"], 1), dtype=mask.dtype)
            slice_in, slice_out = self._sub_crop["slice_in"], self._sub_crop["slice_out"]
 </s> add         if self._sub_crop_size:  # Crop the mask to the given centering
            out = np.zeros((self._sub_crop_size, self._sub_crop_size, 1), dtype=mask.dtype)
            slice_in, slice_out = self._sub_crop_slices["in"], self._sub_crop_slices["out"] </s> remove                      "sub_crop_offset: %s, centering: '%s', predicted_mask: %s",
                     detected_face, sub_crop_offset, centering, predicted_mask is not None)
        mask = self._get_mask(detected_face, predicted_mask, centering, sub_crop_offset)
 </s> add                      "source_offset: %s, target_offset: %s, centering: '%s', predicted_mask: %s",
                     detected_face, source_offset, target_offset, centering,
                     predicted_mask is not None)
        mask = self._get_mask(detected_face,
                              predicted_mask,
                              centering,
                              source_offset,
                              target_offset)
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
              mask = cv2.resize(mask,
                                self._box.shape[:2],
                                interpolation=interp)[..., None].astype("float32") / 255.
          else:
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
            face_mask = face_mask.astype("float32") / 255.
        return face_mask
  
      # MASK MANIPULATIONS
      def _erode(self, mask: np.ndarray) -> np.ndarray:
          """ Erode or dilate mask the mask based on configuration options.
  
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 keep keep keep keep keep
 lib.detected_face.Mask
  - Add source + target offset and coverage to set_sub_crop method 
plugins/convert/mask/mask_blend.py