zsh2000 / SS-NeRF

[WACV 2023] Code for "Beyond RGB: Scene-Property Synthesis with Neural Radiance Fields"
28 stars 1 forks source link

about the npy file #2

Open zw20130717 opened 3 weeks ago

zw20130717 commented 3 weeks ago

Hi, I'm new to 3D reconstruction and I want to know how to visualize the seg.npy in the logs folder. I have successfully visualized other npy documents but when it came to the seg.npy document, I ran into error information. 2024-06-12 16-29-15 的屏幕截图 2024-06-12 16-29-03 的屏幕截图

zsh2000 commented 2 weeks ago

Hi @zw20130717! If you would like to visualize the segmentation map, you need to convert the segmentation maps to 3 channels (RGB for 3 channels). The reason why the seg.npy files cannot be directly visualized is because it is now 13 channels (as you can see from the error message of the tensor shape being (480, 640, 13)). You could either map the semantic class manually using a (13, 3) mapping table, with each row being the RGB color for each semantic class, or use some existing functions like those in matplotlib https://matplotlib.org/stable/users/explain/colors/colormaps.html to map the discrete class indices to RGB colors.

zw20130717 commented 2 weeks ago

Hi @zw20130717! If you would like to visualize the segmentation map, you need to convert the segmentation maps to 3 channels (RGB for 3 channels). The reason why the seg.npy files cannot be directly visualized is because it is now 13 channels (as you can see from the error message of the tensor shape being (480, 640, 13)). You could either map the semantic class manually using a (13, 3) mapping table, with each row being the RGB color for each semantic class, or use some existing functions like those in matplotlib https://matplotlib.org/stable/users/explain/colors/colormaps.html to map the discrete class indices to RGB colors.

You've been such helpful! Thank you for your reply!