          sizes = (self.input_size, self.input_size)
          rois = []
          faces = []
          offsets = []
          for det_face, image in zip(batch["detected_faces"], batch["image"]):
              box = (det_face.left,
                     det_face.top,
                     det_face.right,
                     det_face.bottom)
              diff_height_width = det_face.height - det_face.width
              offset_y = int(abs(diff_height_width / 2))
              box_moved = self.move_box(box, [0, offset_y])
              # Make box square.
              roi = self.get_square_box(box_moved)
  
              # Pad the image and adjust roi if face is outside of boundaries
              image, offset = self.pad_image(roi, image)
 
</s> remove     def align_image(self, batch):
        """ Align the incoming image for prediction """
        logger.trace("Aligning image around center")
 </s> add         Returns
        -------
        box: list
            The [left, top, right, bottom] bounding box
        offset: int
            The offset of the box (difference between half width vs height)
        """

        box = cast(List[int], [face.left,
                               face.top,
                               face.right,
                               face.bottom])
        diff_height_width = cast(int, face.height) - cast(int, face.width)
        offset = int(abs(diff_height_width / 2))
        return box, offset

    def align_image(self, batch: AlignerBatch) -> Tuple[List[np.ndarray],
                                                        List[List[int]],
                                                        List[Tuple[int, int]]]:
        """ Align the incoming image for prediction

        Parameters
        ----------
        batch: :class:`AlignerBatch`
            The current batch to align the input for

        Returns
        -------
        faces: list
            List of feed faces for the aligner
        rois: list
            List of roi's for the faces
        offsets: list
            List of offsets for the faces
        """
        logger.trace("Aligning image around center")  # type:ignore </s> remove         batch["feed"] = np.array(faces, dtype="float32")[..., :3].transpose((0, 3, 1, 2))
        return batch
 </s> add         batch.data.append(dict(roi=roi, offsets=offsets))
        batch.feed.append(np.array(faces, dtype="float32")[..., :3].transpose((0, 3, 1, 2)))

    def _get_box_and_offset(self, face: "DetectedFace") -> Tuple[List[int], int]:
        """Obtain the bounding box and offset from a detected face.


        Parameters
        ----------
        face: :class:`~lib.align.DetectedFace`
            The detected face object to obtain the bounding box and offset from </s> remove     @staticmethod
    def pad_image(box, image):
        """Pad image if face-box falls outside of boundaries """
 </s> add     @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
        """ </s> remove         self._faces_per_filename = {}  # Tracking for recompiling face batches
        self._rollover = None  # Items that are rolled over from the previous batch in get_batch
        self._output_faces = []
        self._additional_keys = []
 </s> add         self._faces_per_filename: Dict[str, int] = {}  # Tracking for recompiling batches
        self._rollover: Optional[ExtractMedia] = None  # batch rollover items
        self._output_faces: List[DetectedFace] = []
        self._filter = AlignedFilter(min_scale=self.config["aligner_min_scale"],
                                     max_scale=self.config["aligner_max_scale"],
                                     distance=self.config["aligner_distance"]) </s> remove         sizes = (self.input_size, self.input_size)
        batch_shape = batch["center_scale"].shape[:2]
 </s> add         batch_shape = center_scale.shape[:2]
        for det_face, image in zip(batch.detected_faces, batch.image):
            box, offset_y = self._get_box_and_offset(det_face)
            box_moved = self.move_box(box, (0, offset_y))
          sizes = (self.input_size, self.input_size)
          rois = []
          faces = []
          offsets = []
        for det_face, image in zip(batch.detected_faces, batch.image):
            box, offset_y = self._get_box_and_offset(det_face)
            box_moved = self.move_box(box, (0, offset_y))
        for det_face, image in zip(batch.detected_faces, batch.image):
            box, offset_y = self._get_box_and_offset(det_face)
            box_moved = self.move_box(box, (0, offset_y))
        for det_face, image in zip(batch.detected_faces, batch.image):
            box, offset_y = self._get_box_and_offset(det_face)
            box_moved = self.move_box(box, (0, offset_y))
        for det_face, image in zip(batch.detected_faces, batch.image):
            box, offset_y = self._get_box_and_offset(det_face)
            box_moved = self.move_box(box, (0, offset_y))
        for det_face, image in zip(batch.detected_faces, batch.image):
            box, offset_y = self._get_box_and_offset(det_face)
            box_moved = self.move_box(box, (0, offset_y))
        for det_face, image in zip(batch.detected_faces, batch.image):
            box, offset_y = self._get_box_and_offset(det_face)
            box_moved = self.move_box(box, (0, offset_y))
        for det_face, image in zip(batch.detected_faces, batch.image):
            box, offset_y = self._get_box_and_offset(det_face)
            box_moved = self.move_box(box, (0, offset_y))
        for det_face, image in zip(batch.detected_faces, batch.image):
            box, offset_y = self._get_box_and_offset(det_face)
            box_moved = self.move_box(box, (0, offset_y))
              # Make box square.
              roi = self.get_square_box(box_moved)
  
              # Pad the image and adjust roi if face is outside of boundaries
              image, offset = self.pad_image(roi, image)
keep keep keep keep replace replace replace replace replace 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