How to compute mean and standard deviation of an image dataset?
Training images
to get the mean, we simply divide the sum of pixel values by count - the total number of pixels in the dataset computed as len(df) * image_size * image_size . to get the standard deviation, we use the following equation: total_std = sqrt(psum_sq / count - total_mean ** 2) .