mighty.utils.data.normalize.dataset_mean_std

mighty.utils.data.normalize.dataset_mean_std(dataset_cls: type, cache=True, verbose=False)[source]

Estimates dataset mean and std.

Parameters:
dataset_clstype

A dataset class.

cachebool, optional

Compute once (True) or every time (False). Default: True

verbosebool, optional

Verbosity flag. Default: False

Returns:
mean, std(C, H, W) torch.Tensor

Channel- and pixel-wise dataset mean and std, estimated over all samples.