You can see how to calculate  mean and ZCA mat from this repo 90. After calculating, save the mean and ZCA mat using scipy.io.save() api. Then, when training, you can load the mean and mat using this code 35.