Coder Social home page Coder Social logo

Render depth map about scaffold-gs HOT 5 OPEN

city-super avatar city-super commented on May 18, 2024
Render depth map

from scaffold-gs.

Comments (5)

ingra14m avatar ingra14m commented on May 18, 2024 1

Hi @aiyb1314 , I have implemented a Differential Gaussian Rasterization with forward depth pass diff-gaussian-rasterization-extentions modified to Scaffold-GS. This is an independent repo that has the same contents with my another repo folked from official diff-gaussian-rasterization.

The only change you need to make is to include depth in the return values of gaussian_renderer/__init__.py:

rendered_image, radii, depth = rasterizer(
        means3D=xyz,
        means2D=screenspace_points,
        shs=None,
        colors_precomp=color,
        opacities=opacity,
        scales=scaling,
        rotations=rot,
        cov3D_precomp=None)

I did not include depth backward pass in that branch. It just outputs the depth. Feel free to use it.

from scaffold-gs.

inspirelt avatar inspirelt commented on May 18, 2024

Hi, two ways can generate the depth map:

  1. Override the color with distance from xyz to camera_center and do rasterization:
xyz_dist = torch.norm(xyz - viewpoint_camera.camera_center, dim=-1, keepdims=True)
color = xyz_dist.repeat([1, 3])
  1. Modify the CUDA rasterization according to https://github.com/graphdeco-inria/diff-gaussian-rasterization/pull/5/files

from scaffold-gs.

zsz-pro avatar zsz-pro commented on May 18, 2024

Hi, two ways can generate the depth map:

  1. Override the color with distance from xyz to camera_center and do rasterization:
xyz_dist = torch.norm(xyz - viewpoint_camera.camera_center, dim=-1, keepdims=True)
color = xyz_dist.repeat([1, 3])
  1. Modify the CUDA rasterization according to https://github.com/graphdeco-inria/diff-gaussian-rasterization/pull/5/files

image

I tried both methods mentioned above. The middle image corresponds to method 1, and the right image corresponds to method 2. These two are quite similar. However, the image on the left is obtained from a monocular depth model, and compared to that, neither of these methods produces correct depth maps. Here, I used cv2.COLORMAP_JET for the color space of depth mapping. Could you give me some guidance? Thanks

from scaffold-gs.

inspirelt avatar inspirelt commented on May 18, 2024

'blue' denotes 'far' in the right two images, but denotes 'near' in the left image. Are there some misaligned rules?

from scaffold-gs.

zsz-pro avatar zsz-pro commented on May 18, 2024

'blue' denotes 'far' in the right two images, but denotes 'near' in the left image. Are there some misaligned rules?

Thanks, I got it. The depth estimated by midas(the pretrained model I use) is the inverse depth maps

from scaffold-gs.

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.