The mean and std are the values that will be used in this equation: X' = (X-mean)/std.
It’s optional whether you want to calculate exactly the mean and std of your training data or just use these generic values of (0.5, 0.5, 0.5). But, it’s very common practice to just use generic values mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5). The purpose of using these values is to convert the range of pixel intensities from [0, 1] to [-1, 1].
Having pixel intensity range of [-1, 1] is specially important in case you have an autoencoder and you want to use Tanh() activation in your last layer as output. Because, Tanh() generates outputs in the range (-1, 1) and so the input to the autoencoder should also be in the same range.