@@ -133,11 +133,11 @@ def from_config(cls, config: dict[str, Any]) -> "Compose":
133
133
return cls (transforms = transforms )
134
134
135
135
@staticmethod
136
- def _get_convert_to_rgb (transforms : list [Transform ], config : dict [str , Any ]):
136
+ def _get_convert_to_rgb (transforms : list [Transform ], config : dict [str , Any ]) -> None :
137
137
transforms .append (ConvertToRGB ())
138
138
139
139
@classmethod
140
- def _get_resize (cls , transforms : list [Transform ], config : dict [str , Any ]):
140
+ def _get_resize (cls , transforms : list [Transform ], config : dict [str , Any ]) -> None :
141
141
mode = config .get ("image_processor_type" , "CLIPImageProcessor" )
142
142
if mode == "CLIPImageProcessor" :
143
143
if config .get ("do_resize" , False ):
@@ -200,7 +200,7 @@ def _get_resize(cls, transforms: list[Transform], config: dict[str, Any]):
200
200
raise ValueError (f"Preprocessor { mode } is not supported" )
201
201
202
202
@staticmethod
203
- def _get_center_crop (transforms : list [Transform ], config : dict [str , Any ]):
203
+ def _get_center_crop (transforms : list [Transform ], config : dict [str , Any ]) -> None :
204
204
mode = config .get ("image_processor_type" , "CLIPImageProcessor" )
205
205
if mode == "CLIPImageProcessor" :
206
206
if config .get ("do_center_crop" , False ):
@@ -220,24 +220,24 @@ def _get_center_crop(transforms: list[Transform], config: dict[str, Any]):
220
220
raise ValueError (f"Preprocessor { mode } is not supported" )
221
221
222
222
@staticmethod
223
- def _get_pil2ndarray (transforms : list [Transform ], config : dict [str , Any ]):
223
+ def _get_pil2ndarray (transforms : list [Transform ], config : dict [str , Any ]) -> None :
224
224
transforms .append (PILtoNDarray ())
225
225
226
226
@staticmethod
227
- def _get_rescale (transforms : list [Transform ], config : dict [str , Any ]):
227
+ def _get_rescale (transforms : list [Transform ], config : dict [str , Any ]) -> None :
228
228
if config .get ("do_rescale" , True ):
229
229
rescale_factor = config .get ("rescale_factor" , 1 / 255 )
230
230
transforms .append (Rescale (scale = rescale_factor ))
231
231
232
232
@staticmethod
233
- def _get_normalize (transforms : list [Transform ], config : dict [str , Any ]):
233
+ def _get_normalize (transforms : list [Transform ], config : dict [str , Any ]) -> None :
234
234
if config .get ("do_normalize" , False ):
235
235
transforms .append (Normalize (mean = config ["image_mean" ], std = config ["image_std" ]))
236
236
elif "mean" in config and "std" in config :
237
237
transforms .append (Normalize (mean = config ["mean" ], std = config ["std" ]))
238
238
239
239
@staticmethod
240
- def _get_pad2square (transforms : list [Transform ], config : dict [str , Any ]):
240
+ def _get_pad2square (transforms : list [Transform ], config : dict [str , Any ]) -> None :
241
241
mode = config .get ("image_processor_type" , "CLIPImageProcessor" )
242
242
if mode == "CLIPImageProcessor" :
243
243
pass
0 commit comments