Open daixiangzi opened 6 years ago
hello,Someone knows how to generate an npy file. thank for your help.
@Totoro-wen What really do you want to do? I will give you an example.
import numpy as np
x=some_array_I_have_created
np.save(path/to/where/file/hould/be/saved/flename, x)
There, you have a numpy file created
thanks.@rocksyne
Firstly,I want to convert this project (or this idea of 3D convolution) into pytorch, so that I can better use it in the aspect of CV. The first time I used tensorlow.
Secondly,Is the npy file generated from training images?This file is useful in the following code, which I cannot fully understand.
img = img[crop_x:crop_x+crop_size, crop_y:crop_y+crop_size,:] - np_mean[j]
@Totoro-wen The purpose of the numpy file is for data normalization. Therefore, the mean calculated over all the training images (frames) which is now stacked as 112x112x3 is saved as a numpy file.
So in training, each for each extracted frame, which is of shape 112x112x3, the np_mean is extracted to try to bring the matrix values to a somewhat central (0) point so that the values will not be too far apart. Kindly check this link to if there is any confusion.. Cheers!
@rocksyne I see. Thank you very much.
@rocksyne I don't know how to generate the crop_mean.npy file. Do you know how to generate it?
@rocksyne Thank you very much.
+1 how do you generate it?