hx173149 / C3D-tensorflow

C3D is a modified version of BVLC tensorflow to support 3D ConvNets.
MIT License
588 stars 265 forks source link

how to generate .npy files? #83

Open daixiangzi opened 6 years ago

cyh-dev commented 5 years ago

+1 how do you generate it?

Totoro-wen commented 5 years ago

hello,Someone knows how to generate an npy file. thank for your help.

rocksyne commented 5 years ago

@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

Totoro-wen commented 5 years ago

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]

rocksyne commented 5 years ago

@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!

Totoro-wen commented 5 years ago

@rocksyne I see. Thank you very much.

hdf1112 commented 3 years ago

@rocksyne I don't know how to generate the crop_mean.npy file. Do you know how to generate it?

hdf1112 commented 3 years ago

@rocksyne Thank you very much.