def preprocess_images_to_id_encoder(self, images):
    bboxes = [mtcnn.detect(to_pil(image))[0] for image in images]
    cropped_images = self.crop_tensor_according_to_bboxes(images, bboxes)
    return cropped_images
def preprocess_images_to_id_encoder(self, images):
    bboxes = [mtcnn.detect(to_pil(image))[0] for image in images]
    cropped_images = self.crop_tensor_according_to_bboxes(images, bboxes)
    return cropped_images