-
Notifications
You must be signed in to change notification settings - Fork 46
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 compute mean/std? #12
Comments
Sorry that I just see your comments yet. |
def findMean(center):
trainingImageDir = './train_nyu/'
mean_D = 0
for i in tqdm(range(72757)): #72757
D_ = scio.loadmat(trainingImageDir + str(i+1) + '.mat')['depth']
D_ = np.array(D_,dtype=np.float)
new_Xmin = center[i][0][0] - cropHandWidth//2
new_Ymin = center[i][0][1] - cropHandHeight//2
new_Xmax = center[i][0][0] + cropHandWidth//2
new_Ymax = center[i][0][1] + cropHandHeight//2
D = D_[int(new_Ymin):int(new_Ymax), int(new_Xmin):int(new_Xmax)]
D[np.where(D >= center[i][0][2] + 200)] = center[i][0][2]
D[np.where(D <= center[i][0][2] - 200)] = center[i][0][2]
D -= center[i][0][2]
mean_D_ = D.mean(0).mean(0)
mean_D += mean_D_
# print(i)
mean_D /= 72757
return mean_D I hope this helps. |
Yes it really helps and I have understood. Thanks for your kind explanation! I will close this issue |
Hello @zhangboshen, I tried to reproduce this but don't get the same results as yours. I believe it is the @DMCNerooo does yours match |
Hello @canuck6ix , I just want to understand the computation of mean/std in the data folder, but don't re-compute it. I use the value provided by the author. I think you can try to utilize above code "findMean" to get mean and then std, maybe there is little difference with author's but doesn't matter. |
@DMCNerooo Thanks for confirming width and height. I did utilize the code above and they are a bit different from the pre-computed ones. Here are the two for comparison: |
@canuck6ix , I am sorry I just see your discuss now. And you can use your |
Hello, thanks for your interesting work! I wonder how to compute mean/std in the data folder, i.e. are they some statistics on training set? Looking forward to your reply!
The text was updated successfully, but these errors were encountered: