Loping151 / ForPlane

Neural LerPlane Representations for Fast 4D Reconstruction of Deformable Tissues
Other
48 stars 2 forks source link

Question about the shape of input pts #7

Closed JerryPW closed 11 months ago

JerryPW commented 11 months ago

Hi, Thanks for your great work! Recently, I've been reading your code and found something strange: when points are put into the model, the shape of the pts should be [n_rays, n_samples, 3]. However, as I print out the shape of the position in lerplanes.models.lowrank_model.py in forward function, it turns out a 3D shape with [1343940, 1, 3]. Why the n_samples = 1 in this condition? How does the number 1343940 be calculated? Holping for your reply soon.

Loping151 commented 11 months ago

[n_rays, n_samples, 3] means you sample a fixed number of points on a ray. However, we applied the efficient ray marching method. The process of volume rendering greatly benefits from the precise sampling of spatiotemporal points, particularly around tissue regions. Although the sample-net introduced in Lerplane delivers improved precision near the surface, it also necessitates extensive point sampling throughout the whole pipeline, which substantially slows down inference speed. To address this issue, we design an indicator grid that directs the Forplane's focus towards the tissue surface. This method is inspired by the grid representation method used in static scene reconstruction, and it serves to optimize ray marching. The indicator grid functions as a binary map which is cached and updated throughout the training process, signifying empty areas. This low cost grid allows for the early termination of the marching process, based on the transmittance along the ray. (Note, the released code includes features of Forplane, which is not explained in the Lerplane paper. Anyway, you can treat it as code for Lerplane as well.) In short, the occ grid samples points from a ray adaptively, so this 1343940 is already the number of total points. However, we still support using sample net in config, so we keep the shape as 3D. The pts will be .reshape(-1) in forward() so there's no actual difference. (wait, another lab on it from sjtu?

JerryPW commented 11 months ago

Thanks for reply! Yes, I am a junior student from SJTU, and I am currently working on the application of NeRF in surgical scenarios. Our lab hopes to make further improvements based on your project. Is it convenient for you to leave a contact method for more in-depth communication in the future?