SelfSupDataPreprocessor¶
- class mmpretrain.models.utils.data_preprocessor.SelfSupDataPreprocessor(mean=None, std=None, pad_size_divisor=1, pad_value=0, to_rgb=False, bgr_to_rgb=False, rgb_to_bgr=False, non_blocking=False)[source]¶
Image pre-processor for operations, like normalization and bgr to rgb.
Compared with the
mmengine.ImgDataPreprocessor
, this module supportsinputs
as torch.Tensor or a list of torch.Tensor.- forward(data, training=False)[source]¶
Performs normalization and bgr2rgb conversion based on
BaseDataPreprocessor
.- Parameters:
- Returns:
Data in the same format as the model input.
- Return type:
Tuple[torch.Tensor, Optional[list]]