VideoNormalize#
- class torchaug.transforms.VideoNormalize(mean=None, std=None, cast_dtype=None, inplace=False, value_check=False, video_format='CTHW')[source]#
Normalize a tensor video with mean and standard deviation. Given mean:
(mean[1],...,mean[n])and std:(std[1],..,std[n])fornchannels, this transform will normalize each channel of the inputtorch.*Tensori.e.,output[channel] = (input[channel] - mean[channel]) / std[channel]Videos should be in format […, T, C, H, W] or […, C, T, H, W] with … 0 or 1 leading dimension.
- Parameters:
mean (
Optional[Sequence[float]], optional) – Sequence of means for each channel.Default:Nonestd (
Optional[Sequence[float]], optional) – Sequence of standard deviations for each channel.Default:Nonevideo_format (
str, optional) – Dimension order of the video. Can beTCHWorCTHW.Default:'CTHW'cast_dtype (
Optional[dtype], optional) – If not None, scale and cast input to the dtype. Expected to be a float dtype.Default:Noneinplace (
bool, optional) – Bool to make this operation in-place.Default:Falsevalue_check (
bool, optional) – Bool to perform tensor value check. Might cause slow down on some devices because of synchronization.