Commit 182f20c
authored
* Fix SmolVLM video processor resize using wrong interpolation after image processor backend refactor
The PR #43514 refactored _preprocess to pass resample=resample to resize,
but resize still accepted interpolation as its parameter. The resample kwarg
was silently swallowed by **kwargs, causing interpolation to default to BILINEAR
instead of the intended LANCZOS->BICUBIC path, producing ~0.36 difference in pixel_values.
Fix by renaming the parameter to resample and converting PIL resample integers to
torchvision InterpolationMode via pil_torch_interpolation_mapping, matching the
pattern used in TorchvisionBackend.resize.
* fix
---------
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
1 parent 02c38f7 commit 182f20c
File tree
2 files changed
+18
-7
lines changed- src/transformers/models/smolvlm
- tests/models/smolvlm
2 files changed
+18
-7
lines changedLines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
127 | 132 | | |
128 | 133 | | |
129 | 134 | | |
130 | | - | |
| 135 | + | |
131 | 136 | | |
132 | 137 | | |
133 | 138 | | |
| |||
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
141 | | - | |
142 | | - | |
| 146 | + | |
| 147 | + | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
146 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
147 | 158 | | |
148 | 159 | | |
149 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
| |||
0 commit comments