hwanhuh / 2D-GS-Viser-Viewer

Simple Viser Viewer for 2D Gaussian Splatting for Geometrically Accurate Radiance Fields
61 stars 2 forks source link

ValueError: no field of name opacity #4

Closed AidanNelson closed 3 weeks ago

AidanNelson commented 3 weeks ago

Hi there @hwanhuh

I'm excited to try this viewer.

In loading a .PLY file generated from 2d-gaussian-splatting example code, I am seeing the following error. Any thoughts on what could be the issue?

[INFO] ply path loaded from:  ../output/2dgs/garden/train/ours_7000/fuse_unbounded.ply
Traceback (most recent call last):
  File "./viewer.py", line 556, in <module>
    viewer = Viewer(**viewer_init_args)
  File "./viewer.py", line 92, in __init__
    self.gaussian_model.load_ply(self.ply_path)
  File "/scratch/an2652/2d-gaussian-splatting/scene/gaussian_model.py", line 218, in load_ply
    opacities = np.asarray(plydata.elements[0]["opacity"])[..., np.newaxis]
  File "/scratch/an2652/2d-gaussian-splatting/env/lib/python3.8/site-packages/plyfile.py", line 715, in __getitem__
    return self.data[key]
  File "/scratch/an2652/2d-gaussian-splatting/env/lib/python3.8/site-packages/numpy/core/memmap.py", line 334, in __getitem__
    res = super().__getitem__(index)
ValueError: no field of name opacity

Thanks! Aidan

hwanhuh commented 3 weeks ago

I think that you confused input file format. This viewer for original 2D GS ply file, not exported mesh from render.py. In other words, appropriate input file should be '~/iterations_7000/point_cloud.ply' If you want to view the extracted mesh from TSDF, I recommend you to install and use MeshLab program.

AidanNelson commented 3 weeks ago

Thanks @hwanhuh,

That was the issue.

My working start command is python viewer.py ../output/2dgs/garden/point_cloud/iteration_7000/point_cloud.py

This seems to work well!