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

Pick Renderable points too wasteful? #5

Open
gafniguy opened this issue Jan 28, 2020 · 1 comment
Open

Pick Renderable points too wasteful? #5

gafniguy opened this issue Jan 28, 2020 · 1 comment

Comments

@gafniguy
Copy link

As I was trying to use DSS to render very big (ScanNet) scenes with ca. 300K vertices, I was getting CUDA out of memory issues (>10 GB) in the computation of rho.

I think the in DSS/core/renderer.py, in the function PickRenderablePoints, there might be two independent reasons, leading to memory inefficiency:

  1. to check whether the point is out of camera scope, WIDTH is used twice, i.e both for x and y. For rectangular images this causes extra points to be considered. the canvas HEIGHT isn't used.

  2. As you are using absolute value to check this condition, only half of the image size is actually needed.

So, this can be used as follows, and afaik should produce the same results (please correct me if I'm wrong)

    render_point = render_point & (torch.abs(cameraPoints[:, :, 0] / cameraPoints[:, :, 2]) < (**0.5** *self.camera.width/self.camera.focalLength/self.camera.sv)) # added 0.5 factor
    render_point = render_point & (torch.abs(cameraPoints[:, :, 1] / cameraPoints[:, :, 2]) < (**0.5** *self.camera.**height**/self.camera.focalLength/self.camera.sv)) # changed to height, added 0.5 factor

This cuts memory usage by more than half for me.

Thanks for your great work!

@yifita
Copy link
Owner

yifita commented Mar 15, 2021

Thank you!

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

2 participants