@@ -66,7 +66,7 @@ class EfficientNetImageProcessor(BaseImageProcessor):
6666 `do_resize` in `preprocess`.
6767 size (`dict[str, int]` *optional*, defaults to `{"height": 346, "width": 346}`):
6868 Size of the image after `resize`. Can be overridden by `size` in `preprocess`.
69- resample (`PILImageResampling` filter, *optional*, defaults to 0 ):
69+ resample (`PILImageResampling` filter, *optional*, defaults to `Resampling.BICUBIC` ):
7070 Resampling filter to use if resizing the image. Can be overridden by `resample` in `preprocess`.
7171 do_center_crop (`bool`, *optional*, defaults to `False`):
7272 Whether to center crop the image. If the input size is smaller than `crop_size` along any edge, the image
@@ -102,7 +102,7 @@ def __init__(
102102 self ,
103103 do_resize : bool = True ,
104104 size : Optional [dict [str , int ]] = None ,
105- resample : PILImageResampling = PIL . Image . NEAREST ,
105+ resample : PILImageResampling = PILImageResampling . BICUBIC ,
106106 do_center_crop : bool = False ,
107107 crop_size : Optional [dict [str , int ]] = None ,
108108 rescale_factor : Union [int , float ] = 1 / 255 ,
@@ -133,12 +133,11 @@ def __init__(
133133 self .image_std = image_std if image_std is not None else IMAGENET_STANDARD_STD
134134 self .include_top = include_top
135135
136- # Copied from transformers.models.vit.image_processing_vit.ViTImageProcessor.resize with PILImageResampling.BILINEAR->PILImageResampling.NEAREST
137136 def resize (
138137 self ,
139138 image : np .ndarray ,
140139 size : dict [str , int ],
141- resample : PILImageResampling = PILImageResampling .NEAREST ,
140+ resample : PILImageResampling = PILImageResampling .BICUBIC ,
142141 data_format : Optional [Union [str , ChannelDimension ]] = None ,
143142 input_data_format : Optional [Union [str , ChannelDimension ]] = None ,
144143 ** kwargs ,
@@ -151,8 +150,8 @@ def resize(
151150 Image to resize.
152151 size (`dict[str, int]`):
153152 Dictionary in the format `{"height": int, "width": int}` specifying the size of the output image.
154- resample (`PILImageResampling`, *optional*, defaults to `PILImageResampling.NEAREST `):
155- `PILImageResampling` filter to use when resizing the image e.g. `PILImageResampling.NEAREST `.
153+ resample (`PILImageResampling`, *optional*, defaults to `PILImageResampling.BICUBIC `):
154+ `PILImageResampling` filter to use when resizing the image e.g. `PILImageResampling.BICUBIC `.
156155 data_format (`ChannelDimension` or `str`, *optional*):
157156 The channel dimension format for the output image. If unset, the channel dimension format of the input
158157 image is used. Can be one of:
0 commit comments