Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to generate .npy files? #83

Open
daixiangzi opened this issue Aug 16, 2018 · 8 comments
Open

how to generate .npy files? #83

daixiangzi opened this issue Aug 16, 2018 · 8 comments

Comments

@daixiangzi
Copy link

No description provided.

@cyh-dev
Copy link

cyh-dev commented Nov 25, 2018

+1 how do you generate it?

@Totoro-wen
Copy link

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

@rocksyne
Copy link

@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
Copy link

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
Copy link

@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
Copy link

Totoro-wen commented Apr 22, 2019

@rocksyne I see. Thank you very much.

@hdf1112
Copy link

hdf1112 commented Nov 8, 2020

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

@hdf1112
Copy link

hdf1112 commented Nov 11, 2020

@rocksyne Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants