  
      def crop(self, batch):  # pylint:disable=too-many-locals
          """ Crop image around the center point """
          logger.debug("Cropping images")
          sizes = (self.input_size, self.input_size)
          batch_shape = batch["center_scale"].shape[:2]
          resolutions = np.full(batch_shape, self.input_size, dtype='float32')
          matrix_ones = np.ones(batch_shape + (3,), dtype='float32')
          matrix_size = np.full(batch_shape + (3,), self.input_size, dtype='float32')
          matrix_size[..., 2] = 1.0
          upper_left = self.transform(matrix_ones, batch["center_scale"], resolutions)
 
</s> remove         upper_left = self.transform(matrix_ones, batch["center_scale"], resolutions)
        bot_right = self.transform(matrix_size, batch["center_scale"], resolutions)
 </s> add         upper_left = self.transform(matrix_ones, center_scale, resolutions)
        bot_right = self.transform(matrix_size, center_scale, resolutions) </s> remove     def crop(self, batch):  # pylint:disable=too-many-locals
        """ Crop image around the center point """
 </s> add     def _crop_image(self,
                    image: np.ndarray,
                    top_left: np.ndarray,
                    bottom_right: np.ndarray) -> np.ndarray:
        """ Crop a single image

        Parameters
        ----------
        image: :class:`numpy.ndarray`
            The image to crop
        top_left: :class:`numpy.ndarray`
            The top left (x, y) point to crop from
        bottom_right: :class:`numpy.ndarray`
            The bottom right (x, y) point to crop to

        Returns
        -------
        :class:`numpy.ndarray`
            The cropped image
        """
        bottom_right_width, bottom_right_height = bottom_right[0].astype('int32')
        top_left_width, top_left_height = top_left[0].astype('int32')
        new_dim = (bottom_right_height - top_left_height,
                   bottom_right_width - top_left_width,
                   3 if image.ndim > 2 else 1)
        new_img = np.empty(new_dim, dtype=np.uint8)

        new_x = slice(max(0, -top_left_width),
                      min(bottom_right_width, image.shape[1]) - top_left_width)
        new_y = slice(max(0, -top_left_height),
                      min(bottom_right_height, image.shape[0]) - top_left_height)
        old_x = slice(max(0, top_left_width), min(bottom_right_width, image.shape[1]))
        old_y = slice(max(0, top_left_height), min(bottom_right_height, image.shape[0]))
        new_img[new_y, new_x] = image[old_y, old_x]

        interp = cv2.INTER_CUBIC if new_dim[0] < self.input_size else cv2.INTER_AREA
        return cv2.resize(new_img,
                          dsize=(self.input_size, self.input_size),
                          interpolation=interp)

    def crop(self, batch: AlignerBatch, center_scale: np.ndarray) -> List[np.ndarray]:
        """ Crop image around the center point

        Parameters
        ----------
        batch: :class:`AlignerBatch`
            The current batch to crop the image for
        center_scale: :class:`numpy.ndarray`
            The center and scale for the bounding box

        Returns
        -------
        list
            List of cropped images for the batch
        """ </s> remove         logger.trace("Calculated center and scale: %s", center_scale)
 </s> add         logger.trace("Calculated center and scale: %s", center_scale)  # type:ignore </s> remove             x_center = (face.left + face.right) / 2.0
            y_center = (face.top + face.bottom) / 2.0 - face.height * 0.12
            scale = (face.width + face.height) * self.reference_scale
 </s> add             x_center = (cast(int, face.left) + face.right) / 2.0
            y_center = (cast(int, face.top) + face.bottom) / 2.0 - cast(int, face.height) * 0.12
            scale = (cast(int, face.width) + cast(int, face.height)) * self.reference_scale </s> remove     def process_input(self, batch):
        """ Compile the detected faces for prediction """
 </s> add     def process_input(self, batch: AlignerBatch) -> None:
        """ Compile the detected faces for prediction

        Parameters
        ----------
        batch: :class:`AlignerBatch`
            The current batch to process input for
        """
        batch_shape = center_scale.shape[:2]
  
      def crop(self, batch):  # pylint:disable=too-many-locals
          """ Crop image around the center point """
          logger.debug("Cropping images")
        batch_shape = center_scale.shape[:2]
        batch_shape = center_scale.shape[:2]
          resolutions = np.full(batch_shape, self.input_size, dtype='float32')
          matrix_ones = np.ones(batch_shape + (3,), dtype='float32')
          matrix_size = np.full(batch_shape + (3,), self.input_size, dtype='float32')
          matrix_size[..., 2] = 1.0
          upper_left = self.transform(matrix_ones, batch["center_scale"], resolutions)
keep keep keep keep replace replace keep keep keep keep keep
 Extract updates:
  - Default CPU detector to MTCNN
  - add basic Aligner false positive filters
  - Typing: align + plugins
  - Use specific AlignerBatch class for alignment
  - 
plugins/extract/align/fan.py