From 3cd78be34ee48d429e8f924bc5258bf5c453ea69 Mon Sep 17 00:00:00 2001 From: jp Date: Tue, 19 Nov 2024 20:40:36 +0900 Subject: [PATCH] Fix: siglip image processor rgb_convert is not being applied correctly. (#34301) Fix: do_convert_rgb --- src/transformers/models/siglip/image_processing_siglip.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transformers/models/siglip/image_processing_siglip.py b/src/transformers/models/siglip/image_processing_siglip.py index 5bbeeb74c8f13f..293716b48fa236 100644 --- a/src/transformers/models/siglip/image_processing_siglip.py +++ b/src/transformers/models/siglip/image_processing_siglip.py @@ -198,12 +198,12 @@ def preprocess( size=size, resample=resample, ) - # All transformations expect numpy arrays. - images = [to_numpy_array(image) for image in images] - if do_convert_rgb: images = [convert_to_rgb(image) for image in images] + # All transformations expect numpy arrays. + images = [to_numpy_array(image) for image in images] + if is_scaled_image(images[0]) and do_rescale: logger.warning_once( "It looks like you are trying to rescale already rescaled images. If the input"