Giter Club home page Giter Club logo

Comments (7)

zhangboshen avatar zhangboshen commented on July 28, 2024

Sorry that I just see your comments yet.
And yes, we compute mean/std on training set, specifically, we first crop the original depth maps according to center points, which give us a hand-centered sub-image, then we compute the mean/std of all of these images.

from a2j.

zhangboshen avatar zhangboshen commented on July 28, 2024
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.

from a2j.

DMCNerooo avatar DMCNerooo commented on July 28, 2024

Yes it really helps and I have understood. Thanks for your kind explanation! I will close this issue

from a2j.

canuck6ix avatar canuck6ix commented on July 28, 2024

Hello @zhangboshen, I tried to reproduce this but don't get the same results as yours. I believe it is the cropHandWidth and cropHandHeight. What values do you use for the above?

@DMCNerooo does yours match mean = -0.66877532 and std= 28.32958208

from a2j.

DMCNerooo avatar DMCNerooo commented on July 28, 2024

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.
By the way, both cropHandWidth and cropHandHeight are set to 176 in this paper and project. Good luck!

from a2j.

canuck6ix avatar canuck6ix commented on July 28, 2024

@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:
autor's: mean = -0.67 std = 28.33
mine: mean = -3.86 std = 21.13

from a2j.

zhangboshen avatar zhangboshen commented on July 28, 2024

@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:
autor's: mean = -0.67 std = 28.33
mine: mean = -3.86 std = 21.13

@canuck6ix , I am sorry I just see your discuss now. And you can use your mean/std, I think you can also get a resonable result.

from a2j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.