C3D-tensorflow icon indicating copy to clipboard operation
C3D-tensorflow copied to clipboard

how to generate .npy files?

Open daixiangzi opened this issue 7 years ago • 8 comments

daixiangzi avatar Aug 16 '18 03:08 daixiangzi

+1 how do you generate it?

cyh-dev avatar Nov 25 '18 02:11 cyh-dev

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

Totoro-wen avatar Apr 22 '19 09:04 Totoro-wen

@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

rocksyne avatar Apr 22 '19 09:04 rocksyne

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 avatar Apr 22 '19 10:04 Totoro-wen

@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 avatar Apr 22 '19 11:04 rocksyne

@rocksyne I see. Thank you very much.

Totoro-wen avatar Apr 22 '19 11:04 Totoro-wen

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

hdf1112 avatar Nov 08 '20 02:11 hdf1112

@rocksyne Thank you very much.

hdf1112 avatar Nov 11 '20 02:11 hdf1112