Check whether rescale is requested before checking is_scaled_image (#35439)

This commit is contained in:
Kevin R
2025-01-07 03:39:45 -08:00
committed by GitHub
parent f408d55448
commit 665a4942e4
63 changed files with 63 additions and 63 deletions

View File

@@ -247,7 +247,7 @@ class ImgprocModelImageProcessor(BaseImageProcessor):
# All transformations expect numpy arrays.
images = [to_numpy_array(image) for image in images]
if is_scaled_image(images[0]) and do_rescale:
if do_rescale and is_scaled_image(images[0]):
logger.warning_once(
"It looks like you are trying to rescale already rescaled images. If the input"
" images have pixel values between 0 and 1, set `do_rescale=False` to avoid rescaling them again."