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

Normal map for training #157

Open
Kev1MSL opened this issue May 1, 2024 · 2 comments
Open

Normal map for training #157

Kev1MSL opened this issue May 1, 2024 · 2 comments

Comments

@Kev1MSL
Copy link

Kev1MSL commented May 1, 2024

Hi! I am a bit confused in the training part using meshes. I am trying to use the normal map as a parameter for supervision for guiding the loss function. My goal would be to build a dataset from .obj files and use the renderer for creating the images, as well as their normal map.
You mentioned in #85 that normal map was directly derived from the .obj file for training, but I am wondering how the supervision could work if the normal map derived from the renderer is smoothed but the one from the .obj file is fine. If I am rendering the normal map of a cube I am getting something like that:
normal_map
When I would normally expect the normal map render to look like that:
cube_normal

Not sure if I am missing something...

@jmunkberg
Copy link
Collaborator

Hello @Kev1MSL ,

I'm not sure I understand the issue. When loading a reference mesh from an .obj file, we respect the normals in the file if present: https://github.com/NVlabs/nvdiffrec/blob/main/render/obj.py#L115

For the mesh we optimize, we run auto_normals in each training step:

imesh = mesh.auto_normals(imesh)

@Kev1MSL
Copy link
Author

Kev1MSL commented May 3, 2024

Alright I think I understand better now, but I am not sure why you take the normal from the file, is it for supervision when you train your model?

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