From f12c5d717815333bc74631dd9d5f79a1a0f0e133 Mon Sep 17 00:00:00 2001 From: yonigozlan Date: Wed, 11 Dec 2024 22:34:22 +0000 Subject: [PATCH] fix-copies --- .../models/aria/image_processing_aria.py | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/transformers/models/aria/image_processing_aria.py b/src/transformers/models/aria/image_processing_aria.py index 7b00665aa2859d..8e9c8e2272f979 100644 --- a/src/transformers/models/aria/image_processing_aria.py +++ b/src/transformers/models/aria/image_processing_aria.py @@ -31,7 +31,7 @@ PILImageResampling, get_image_size, infer_channel_dimension_format, - is_valid_image, + make_batched_images, to_numpy_array, valid_images, validate_preprocess_arguments, @@ -39,29 +39,6 @@ from ...utils import TensorType -def make_batched_images(images) -> List[List[ImageInput]]: - """ - Accepts images in list or nested list format, and makes a list of images for preprocessing. - - Args: - images (`Union[List[List[ImageInput]], List[ImageInput], ImageInput]`): - The input image. - - Returns: - list: A list of images. - """ - if isinstance(images, (list, tuple)) and isinstance(images[0], (list, tuple)) and is_valid_image(images[0][0]): - return [img for img_list in images for img in img_list] - - elif isinstance(images, (list, tuple)) and is_valid_image(images[0]): - return images - - elif is_valid_image(images): - return [images] - - raise ValueError(f"Could not make batched video from {images}") - - def divide_to_patches(image: np.array, patch_size: int, input_data_format) -> List[np.array]: """ Divides an image into patches of a specified size.