DSS
DSS copied to clipboard
Pick Renderable points too wasteful?
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:
-
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.
-
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!
Thank you!