hbb1/2d-gaussian-splatting

Incorrect normal color

JuewenPeng opened this issue · 5 comments

Hi, I could not visualize the correct normal map during training. Could you give me some suggestions or provide the visualization code? Thank you very much.

Here is my normal map produced by
cv2.imwrite('normal.jpg', (0.5*rend_normal+0.5).permute(1,2,0).detach().clone().cpu().numpy() * 255)
image

I have tried running render.py without --skip_train to export training images, but the color of the produced normal map is still weird.
image

hbb1 commented

what do you mean 'weird'? I think the normal looks just fine.

It is inconsistent with the color of the paper.

image

hbb1 commented

Ahhhh, this is that we visualize the normal in view space while our default output is world space.
To render image in view space with color like the teaser,

  # get normal map
  # transform normal from view space to world space
  render_normal = allmap[2:5]
  render_normal = (render_normal.permute(1,2,0) @ (viewpoint_camera.world_view_transform[:3,:3].T)).permute(2,0,1)
  
  # render the view space normal like the teaser figure
  view_normal = -allmap[2:5]