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

Incorrect "invalid_mask" in "save_ply" #577

Open
Daaohame opened this issue Mar 7, 2025 · 0 comments
Open

Incorrect "invalid_mask" in "save_ply" #577

Daaohame opened this issue Mar 7, 2025 · 0 comments

Comments

@Daaohame
Copy link

Daaohame commented Mar 7, 2025

Hi, @MrNeRF @maturk

Thanks for adding save_ply (#234 #427).

However, there is a bug in save_ply: the invalid_mask calculation where np.isnan(opacities).any(axis=0) marks the entire mask as True, causing all data points to be invalid. This happens because opacities has shape (N,), and using axis=0 makes the any() function return a single boolean value instead of row-wise filtering.

Steps to Reproduce:

  1. Run the code with an opacities array containing some NaN values.
  2. Observe that invalid_mask becomes completely True, invalidating all rows. This means no points will be saved.

Suggested Fix:
Replace
np.isnan(opacities).any(axis=0) | np.isinf(opacities).any(axis=0)
with
np.isnan(opacities) | np.isinf(opacities).

Version: Commit 1a1e0cc

Thanks for the great repo! Let me know if I can help with a fix.

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

1 participant