Git Product home page Git Product logo

Comments (5)

xy-guo avatar xy-guo commented on July 18, 2024

It is trying to add two more dimensions for elementwise multiplication. I think there is no bug.

from mvsnet_pytorch.

progressforever avatar progressforever commented on July 18, 2024

It is trying to add two more dimensions for elementwise multiplication. I think there is no bug.

Thank you for you reply, However, the
depth_values = depth_values.view(*depth_values.shape, 1, 1)
what is the * mean?

from mvsnet_pytorch.

xy-guo avatar xy-guo commented on July 18, 2024

It is to unpack depth_values.shape as function arguments (you can refer to python tutorials for more information). It is the same as

depth_values = depth_values.view(depth_values.shape[0], depth_values.shape[1], 1, 1)  # only when len(depth_values.shape) == 2

from mvsnet_pytorch.

progressforever avatar progressforever commented on July 18, 2024

It is to unpack depth_values.shape as function arguments (you can refer to python tutorials for more information). It is the same as

depth_values = depth_values.view(depth_values.shape[0], depth_values.shape[1], 1, 1)  # only when len(depth_values.shape) == 2

Thank you ~ It works! And I want to konw whether the following code can replace this line?

p: probability volume [B, D, H, W]

depth_values: discrete depth values [B, D]

def depth_regression(p, depth_values):
#depth_values = torch.reshape(depth_values,(256))
depth_values = depth_values.cpu().numpy()
start = depth_values[0][0]
end = depth_values[0][-1]
interval = (end - start) / 256
disp = Variable(torch.Tensor(np.reshape(np.array(np.arange(start,end,interval)),[1,256,1,1])).cuda(), requires_grad=False)
disp = disp.repeat(p.size()[0],1,p.size()[2],p.size()[3])
#print('depth_value ', depth_values.shape)
depth = torch.sum(p * disp, 1)

return depth

from mvsnet_pytorch.

xy-guo avatar xy-guo commented on July 18, 2024

I'm not sure. You can check by yourself.

from mvsnet_pytorch.

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.