          assert ((right - left) == (bottom - top)), 'Box is not square.'
  
          return [left, top, right, bottom]
  
      @staticmethod
      def pad_image(box, image):
          """Pad image if face-box falls outside of boundaries """
          height, width = image.shape[:2]
          pad_l = 1 - box[0] if box[0] < 0 else 0
          pad_t = 1 - box[1] if box[1] < 0 else 0
          pad_r = box[2] - width if box[2] > width else 0
          pad_b = box[3] - height if box[3] > height else 0
 
</s> remove         logger.trace("Padding: (l: %s, t: %s, r: %s, b: %s)", pad_l, pad_t, pad_r, pad_b)
 </s> add         logger.trace("Padding: (l: %s, t: %s, r: %s, b: %s)",  # type:ignore
                     pad_l, pad_t, pad_r, pad_b) </s> remove         new_images = []
        for image, top_left, bottom_right in zip(batch["image"], upper_left, bot_right):
            height, width = image.shape[:2]
            channels = 3 if image.ndim > 2 else 1
            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,
                       channels)
            new_img = np.empty(new_dim, dtype=np.uint8)

            new_x = slice(max(0, -top_left_width), min(bottom_right_width, width) - top_left_width)
            new_y = slice(max(0, -top_left_height),
                          min(bottom_right_height, height) - top_left_height)
            old_x = slice(max(0, top_left_width), min(bottom_right_width, width))
            old_y = slice(max(0, top_left_height), min(bottom_right_height, height))
            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
            new_images.append(cv2.resize(new_img, dsize=sizes, interpolation=interp))
        logger.trace("Cropped images")
 </s> add         new_images = [self._crop_image(image, top_left, bottom_right)
                      for image, top_left, bottom_right in zip(batch.image, upper_left, bot_right)]
        logger.trace("Cropped images")  # type:ignore </s> remove     def get_square_box(box):
        """Get a square box out of the given box, by expanding it."""
 </s> add     def get_square_box(box: List[int]) -> List[int]:
        """Get a square box out of the given box, by expanding it.

        Parameters
        ----------
        box: list
            The (`left`, `top`, `right`, `bottom`) box positions

        Returns
        -------
        list
            The original box but made square
        """ </s> remove         batch = {}
 </s> add         batch = AlignerBatch() </s> remove     def init_model(self):
 </s> add     def init_model(self) -> None:
    @classmethod
    def pad_image(cls, box: List[int], image: np.ndarray) -> Tuple[np.ndarray, Tuple[int, int]]:
        """Pad image if face-box falls outside of boundaries

        Parameters
        ----------
        box: list
            The (`left`, `top`, `right`, `bottom`) roi box positions
        image: :class:`numpy.ndarray`
            The image to be padded

        Returns
        -------
        :class:`numpy.ndarray`
            The padded image
        """
          assert ((right - left) == (bottom - top)), 'Box is not square.'
  
          return [left, top, right, bottom]
  
    @classmethod
    def pad_image(cls, box: List[int], image: np.ndarray) -> Tuple[np.ndarray, Tuple[int, int]]:
        """Pad image if face-box falls outside of boundaries

        Parameters
        ----------
        box: list
            The (`left`, `top`, `right`, `bottom`) roi box positions
        image: :class:`numpy.ndarray`
            The image to be padded

        Returns
        -------
        :class:`numpy.ndarray`
            The padded image
        """
    @classmethod
    def pad_image(cls, box: List[int], image: np.ndarray) -> Tuple[np.ndarray, Tuple[int, int]]:
        """Pad image if face-box falls outside of boundaries

        Parameters
        ----------
        box: list
            The (`left`, `top`, `right`, `bottom`) roi box positions
        image: :class:`numpy.ndarray`
            The image to be padded

        Returns
        -------
        :class:`numpy.ndarray`
            The padded image
        """
    @classmethod
    def pad_image(cls, box: List[int], image: np.ndarray) -> Tuple[np.ndarray, Tuple[int, int]]:
        """Pad image if face-box falls outside of boundaries

        Parameters
        ----------
        box: list
            The (`left`, `top`, `right`, `bottom`) roi box positions
        image: :class:`numpy.ndarray`
            The image to be padded

        Returns
        -------
        :class:`numpy.ndarray`
            The padded image
        """
          height, width = image.shape[:2]
          pad_l = 1 - box[0] if box[0] < 0 else 0
          pad_t = 1 - box[1] if box[1] < 0 else 0
          pad_r = box[2] - width if box[2] > width else 0
          pad_b = box[3] - height if box[3] > height else 0
keep keep keep keep replace 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/cv2_dnn.py