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

add normal rendering into neus #32

Closed
wants to merge 1 commit into from

Conversation

pablovela5620
Copy link

I haven't yet managed to get things working with monocular cues over on PR #21 . I've been going through the Neuris and MonoSDF papers/repos (very similar approaches, just slight differences in implementation details/filtering) to see what may be going wrong. In the meantime, I wanted to contribute something so I'll opened this PR to add normal rendering to the NeUS system/model.

I did some timing and found that without normal rendering on the lego scene without a mask it took around 15 minutes
Doing the naive implementation

        n_rays = packed_info.shape[0]
        ray_indices = unpack_info(packed_info)
        alphas = alpha_fn(t_starts, t_ends, ray_indices.long())
        weights = render_weight_from_alpha(
            packed_info, alphas
        )

        normal_map = accumulate_along_rays(
            weights,
            ray_indices,
            values=sdf_grad_samples,
            n_rays=n_rays,
        )

took around 18 minutes, and modifying the rendering function and rgb_alpha_fn to generate the normal map took around 16 minutes. This version is much less clean, but I think it probably makes sense considering for longer renders there will be a large time savings

I tested this with the Lego scene and DTU 65 using colmap. Things didn't seem to work with colmap and I'm not fully sure why. Heres the gifs of the outputs from both
lego-normal
colmap-normal

Feels like there's something wrong with the camera parameters after using colmap. Heres an example image from one of the validation runs
it10000-0

lmk your thoughts.

@bennyguo
Copy link
Owner

bennyguo commented Feb 7, 2023

Sorry for the late response. The normal rendering has been added in 17b22f9. The current version uses render_weight_from_alpha and accumulate_along_rays , and I did not observe significant performance drop. Welcome to have a try!

@bennyguo bennyguo closed this Feb 7, 2023
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

Successfully merging this pull request may close these issues.

2 participants