          self.model.setPreferableTarget(cv2.dnn.DNN_TARGET_CPU)  # pylint: disable=no-member
  
      def process_input(self, batch):
          """ Compile the detected faces for prediction """
          faces, batch["roi"] = self.align_image(batch)
          faces = self._normalize_faces(faces)
          batch["feed"] = np.array(faces, dtype="float32")[..., :3].transpose((0, 3, 1, 2))
          return batch
  
      def align_image(self, batch):
 
</s> remove         retval = cv2.copyMakeBorder(image.copy(),
                                    pad_t,
                                    pad_b,
                                    pad_l,
                                    pad_r,
                                    cv2.BORDER_CONSTANT,
                                    value=(0, 0, 0))
        logger.trace("Padded shape: %s", retval.shape)
        return retval
 </s> add         padded_image = cv2.copyMakeBorder(image.copy(),
                                          pad_t,
                                          pad_b,
                                          pad_l,
                                          pad_r,
                                          cv2.BORDER_CONSTANT,
                                          value=(0, 0, 0))
        offsets = (pad_l - pad_r, pad_t - pad_b)
        logger.trace("image_shape: %s, Padded shape: %s, box: %s, offsets: %s",
                     image.shape, padded_image.shape, box, offsets)
        return padded_image, offsets </s> remove         return faces, rois
 </s> add             offsets.append(offset)
        return faces, rois, offsets </s> remove             # Pad the image if face is outside of boundaries
            image = self.pad_image(roi, image)
            face = image[roi[1]: roi[3], roi[0]: roi[2]]
 </s> add 
        faces, batch["roi"], batch["offsets"] = self.align_image(batch)
          self.model.setPreferableTarget(cv2.dnn.DNN_TARGET_CPU)  # pylint: disable=no-member
  
      def process_input(self, batch):
          """ Compile the detected faces for prediction """
        faces, batch["roi"], batch["offsets"] = self.align_image(batch)
          faces = self._normalize_faces(faces)
          batch["feed"] = np.array(faces, dtype="float32")[..., :3].transpose((0, 3, 1, 2))
          return batch
  
      def align_image(self, batch):
keep keep keep keep replace keep keep keep keep keep
 bugfix: CV2-DNN aligner. Fix Assertion error when bounding box falls out of frame 
plugins/extract/align/cv2_dnn.py