Skip to content

Incorrect "invalid_mask" in "save_ply" #577

Open
@Daaohame

Description

@Daaohame

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions