However, I do not know how to get the std further effectively.
Can someone tell me how to get it? Better with the corresponding code!
Thanks in advance!
Got same question here. Previously I was using ImageNet fixed Normalize technique. What is the difference between Imagenet and self dataset?
When I used ImageNet Normalize, the image becomes dark(pixels are below 0). I will try to get specific mean and std of my dataset to see if the image would not be black after Normalization.
Just as you did for mean, you can easily adapt your code to calculate standard deviation (after you calculated the means). In addition, if you count the number of pixels (width, height) in the loop, even if your images have different sizes you can get the exact number to divide the sum: