              mask = np.ones_like(self.dummy[:, :, 1], dtype="float32")[..., None]
          elif self.mask_type == "predicted" and predicted_mask is not None:
              mask = predicted_mask[..., None]
          else:
              mask = detected_face.mask[self.mask_type]
              mask.set_blur_and_threshold(blur_kernel=self.config["kernel_size"],
                                          blur_type=self.config["type"],
                                          blur_passes=self.config["passes"],
                                          threshold=self.config["threshold"])
              if sub_crop_offset is not None and np.any(sub_crop_offset):
                  mask.set_sub_crop(sub_crop_offset, centering)
              mask = self._crop_to_coverage(mask.mask)
              mask_size = mask.shape[0]
              face_size = self.dummy.shape[0]
              if mask_size != face_size:
                  interp = cv2.INTER_CUBIC if mask_size < face_size else cv2.INTER_AREA
                  mask = cv2.resize(mask,
                                    self.dummy.shape[:2],
                                    interpolation=interp)[..., None]
              mask = mask.astype("float32") / 255.0
          logger.trace(mask.shape)  # type: ignore
          return mask
  
      def _crop_to_coverage(self, mask: np.ndarray) -> np.ndarray:
          """ Crop the mask to the correct dimensions based on coverage ratio.
 
</s> remove         if self.mask_type == "none":
            # Return a dummy mask if not using a mask
            mask = np.ones_like(self.dummy[:, :, 1], dtype="float32")[..., None]
        elif self.mask_type == "predicted" and predicted_mask is not None:
            mask = predicted_mask[..., None]
 </s> add         if self._mask_type == "none":
            mask = np.ones_like(self._box)  # Return a dummy mask if not using a mask
        elif self._mask_type == "predicted" and predicted_mask is not None:
            mask = predicted_mask </s> remove             The mask sized to Faceswap model output with any requested blurring applied.
 </s> add             The requested mask. </s> remove         return mask
 </s> add         return mask[..., None] </s> remove         if not self.skip and self._do_erode:
 </s> add         if self._config.get("type") is not None and self._do_erode: </s> remove         logger.trace(  # type: ignore
            "detected_face: %s, sub_crop_offset: %s, centering: '%s', predicted_mask: %s",
            detected_face, sub_crop_offset, centering, predicted_mask is not None)
 </s> add         logger.trace("Performing mask adjustment: (detected_face: %s, "  # type: ignore
                     "sub_crop_offset: %s, centering: '%s', predicted_mask: %s",
                     detected_face, sub_crop_offset, centering, predicted_mask is not None)
            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

              mask = np.ones_like(self.dummy[:, :, 1], dtype="float32")[..., None]
          elif self.mask_type == "predicted" and predicted_mask is not None:
              mask = predicted_mask[..., None]
          else:
            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

            mask = self._get_stored_mask(detected_face, centering, sub_crop_offset)

          logger.trace(mask.shape)  # type: ignore
          return mask
  
      def _crop_to_coverage(self, mask: np.ndarray) -> np.ndarray:
          """ Crop the mask to the correct dimensions based on coverage ratio.
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 convert: remove box blend plugin 
plugins/convert/mask/mask_blend.py