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

about the npy file #2

Open
zw20130717 opened this issue Jun 12, 2024 · 2 comments
Open

about the npy file #2

zw20130717 opened this issue Jun 12, 2024 · 2 comments

Comments

@zw20130717
Copy link

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
Copy link
Owner

zsh2000 commented Jun 19, 2024

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
Copy link
Author

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!

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