Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b64d760
init refactor
yonigozlan Jan 27, 2026
43ce3c9
Fix llava
yonigozlan Jan 27, 2026
75a5f8b
Merge remote-tracking branch 'upstream/main' into refactor-improc-bac…
yonigozlan Jan 27, 2026
94e2f2c
changes after review
yonigozlan Feb 2, 2026
34aa802
update first batch of image processors
yonigozlan Feb 5, 2026
21ff306
refactor part 2
yonigozlan Feb 11, 2026
de23b46
improve base image processor class, move backends to separate file
yonigozlan Feb 11, 2026
1d64b21
Merge remote-tracking branch 'upstream/main' into refactor-improc-bac…
yonigozlan Feb 11, 2026
56c49c8
refactor to have backends in separate files, with backends now inheri…
yonigozlan Feb 15, 2026
ad91d8e
fix docstrings
yonigozlan Feb 17, 2026
87dc38b
update some image processors to new refactored standards
yonigozlan Feb 17, 2026
780c0cb
refactor more image processors
yonigozlan Feb 18, 2026
526a668
refactor more image processors
yonigozlan Feb 18, 2026
85207f2
refactor more fast image processors
yonigozlan Feb 20, 2026
e1c56dc
refactor more image processors
yonigozlan Feb 20, 2026
be2d888
refactor more image processor
yonigozlan Feb 24, 2026
ed57337
improve compatibility with video processors
yonigozlan Feb 24, 2026
fbf6be5
refactor more image processors
yonigozlan Feb 25, 2026
6efda3a
add more image processors, improve compatibility with video processors
yonigozlan Feb 25, 2026
97f0dd9
support for modular
yonigozlan Feb 25, 2026
1da0c11
refactor modular ima proc
yonigozlan Feb 26, 2026
f27bce9
refactor more modular image processors
yonigozlan Feb 26, 2026
5135b2b
adjustments before merge
yonigozlan Feb 27, 2026
5641c8e
Merge remote-tracking branch 'upstream/main' into refactor-improc-bac…
yonigozlan Feb 27, 2026
71dd63f
fimish image processors refactor
yonigozlan Mar 3, 2026
6a738de
update docs
yonigozlan Mar 3, 2026
f652f5a
add fallback to Pil backend for backward compat
yonigozlan Mar 3, 2026
80bcfe0
fix repo
yonigozlan Mar 3, 2026
d13f843
Fix all processors and image processors tests
yonigozlan Mar 3, 2026
7d52916
fix modular and style
yonigozlan Mar 3, 2026
6d46b06
fix docs
yonigozlan Mar 3, 2026
0f918df
fix remote code backward compatibility + super in lists
yonigozlan Mar 4, 2026
5b8155d
Merge remote-tracking branch 'upstream/main' into refactor-improc-bac…
yonigozlan Mar 4, 2026
7502afb
Update docs and add new model like cli
yonigozlan Mar 4, 2026
bd4ccc6
fix processor tests
yonigozlan Mar 4, 2026
db34bb3
relax test tvp (used to be skipped)
yonigozlan Mar 4, 2026
3e0a72b
fix 4 channels oneformer
yonigozlan Mar 4, 2026
f5bbf0e
Changes after review
yonigozlan Mar 16, 2026
4a33f7f
Merge remote-tracking branch 'upstream/main' into refactor-improc-bac…
yonigozlan Mar 16, 2026
ae06795
Fixes after review
yonigozlan Mar 16, 2026
a6d7002
Fix tests
yonigozlan Mar 16, 2026
04ef71f
Change imports in modeling tests to minimize integration tests changes
yonigozlan Mar 16, 2026
9b1d3a8
Merge remote-tracking branch 'upstream/main' into refactor-improc-bac…
yonigozlan Mar 16, 2026
ed5a4df
fix wrong import
yonigozlan Mar 16, 2026
304e4b0
Merge remote-tracking branch 'upstream/main' into refactor-improc-bac…
yonigozlan Mar 17, 2026
f42220e
fix import and missing doc
yonigozlan Mar 17, 2026
22037d2
fix typo PI0
yonigozlan Mar 17, 2026
272fdca
Merge remote-tracking branch 'upstream/main' into refactor-improc-bac…
yonigozlan Mar 17, 2026
777551d
Fix all integration tests
yonigozlan Mar 17, 2026
3b9b589
Fix after review, enforce protected torch/torchvision imports in pil …
yonigozlan Mar 18, 2026
b12a20d
Fix style
yonigozlan Mar 18, 2026
9fc7900
Fix test modeling depth pro
yonigozlan Mar 18, 2026
01fb2f1
Fix processing_idefics
yonigozlan Mar 18, 2026
fcd2335
Merge branch 'main' into refactor-improc-backends
yonigozlan Mar 18, 2026
fd54fd7
Merge remote-tracking branch 'upstream/main' into refactor-improc-bac…
yonigozlan Mar 19, 2026
a094cef
Fixes after merge
yonigozlan Mar 19, 2026
33dfa8c
_rescale_and_normalize -> rescale_and_normalize
yonigozlan Mar 19, 2026
8c13796
fix-repo
yonigozlan Mar 19, 2026
7b8d547
Merge branch 'main' into refactor-improc-backends
yonigozlan Mar 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,374 changes: 1,300 additions & 74 deletions src/transformers/image_processing_utils.py

Large diffs are not rendered by default.

952 changes: 0 additions & 952 deletions src/transformers/image_processing_utils_fast.py

This file was deleted.

15 changes: 6 additions & 9 deletions src/transformers/image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@
PILImageResampling.BICUBIC: InterpolationMode.BICUBIC,
PILImageResampling.LANCZOS: InterpolationMode.LANCZOS,
}
# Create inverse mapping: InterpolationMode -> PILImageResampling
torch_pil_interpolation_mapping = {v: k for k, v in pil_torch_interpolation_mapping.items()}
else:
pil_torch_interpolation_mapping = {}
torch_pil_interpolation_mapping = {}


if is_torch_available():
Expand Down Expand Up @@ -514,8 +517,7 @@ def validate_preprocess_arguments(
crop_size: dict[str, int] | None = None,
do_resize: bool | None = None,
size: dict[str, int] | None = None,
resample: Optional["PILImageResampling"] = None,
interpolation: Optional["InterpolationMode"] = None,
resample: Optional[Union["PILImageResampling", "InterpolationMode", int]] = None,
):
"""
Checks validity of typically used arguments in an `ImageProcessor` `preprocess` method.
Expand Down Expand Up @@ -545,13 +547,8 @@ def validate_preprocess_arguments(
if do_center_crop and crop_size is None:
raise ValueError("`crop_size` must be specified if `do_center_crop` is `True`.")

if interpolation is not None and resample is not None:
raise ValueError(
"Only one of `interpolation` and `resample` should be specified, depending on image processor type."
)

if do_resize and not (size is not None and (resample is not None or interpolation is not None)):
raise ValueError("`size` and `resample/interpolation` must be specified if `do_resize` is `True`.")
if do_resize and not (size is not None and resample is not None):
raise ValueError("`size` and `resample` must be specified if `do_resize` is `True`.")


class ImageFeatureExtractionMixin:
Expand Down
554 changes: 277 additions & 277 deletions src/transformers/models/auto/image_processing_auto.py

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/transformers/models/clip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

if TYPE_CHECKING:
from .configuration_clip import *
from .feature_extraction_clip import *
from .image_processing_clip import *
from .image_processing_clip_fast import *
from .modeling_clip import *
from .processing_clip import *
from .tokenization_clip import *
Expand Down
342 changes: 22 additions & 320 deletions src/transformers/models/clip/image_processing_clip.py

Large diffs are not rendered by default.

47 changes: 0 additions & 47 deletions src/transformers/models/clip/image_processing_clip_fast.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/transformers/models/deit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

if TYPE_CHECKING:
from .configuration_deit import *
from .feature_extraction_deit import *
from .image_processing_deit import *
from .image_processing_deit_fast import *
from .modeling_deit import *
else:
import sys
Expand Down
Loading
Loading