dreamgaussian icon indicating copy to clipboard operation
dreamgaussian copied to clipboard

Mesh generation from 3DGS output format

Open hodakagoto opened this issue 2 years ago • 14 comments

Can I generate a mesh from graphdeco-inria/gaussian-splatting output format?

hodakagoto avatar Oct 25 '23 17:10 hodakagoto

@hodakagoto Hi, yes! You can use the load config to directly load the ply files.

ashawkey avatar Oct 27 '23 09:10 ashawkey

@ashawkey I got an error when I ran this command: python main.py --config configs/image.yaml load=/path/to/3dgs-output/input.ply Am I doing something wrong?

hodakagoto avatar Oct 29 '23 18:10 hodakagoto

I also tried this command but got an error:

python main.py --config configs/image.yaml load=miku.ply gui=True

Number of points at loading :  531242
Traceback (most recent call last):
  File "D:\work\dreamgaussian\main.py", line 915, in <module>
    gui = GUI(opt)
  File "D:\work\dreamgaussian\main.py", line 78, in __init__
    self.renderer.initialize(self.opt.load)
  File "D:\work\dreamgaussian\gs_renderer.py", line 713, in initialize
    self.gaussians.load_ply(input)
  File "D:\work\dreamgaussian\gs_renderer.py", line 438, in load_ply
    assert len(extra_f_names)==3*(self.max_sh_degree + 1) ** 2 - 3
AssertionError

What should I do?

camtrik avatar Oct 31 '23 07:10 camtrik

maybe you should rename the directory of '3dgs-output' to '3dgs_output' and change the code to "python main.py --config configs/image.yaml load=/path/to/3dgs_output/input.ply"

maybeLx avatar Nov 01 '23 11:11 maybeLx

@maybeLx The path is an example and does not actually contain -. I get the same error as @camtrik did.

hodakagoto avatar Nov 01 '23 15:11 hodakagoto

I also tried this command but got an error:

python main.py --config configs/image.yaml load=miku.ply gui=True

Number of points at loading :  531242
Traceback (most recent call last):
  File "D:\work\dreamgaussian\main.py", line 915, in <module>
    gui = GUI(opt)
  File "D:\work\dreamgaussian\main.py", line 78, in __init__
    self.renderer.initialize(self.opt.load)
  File "D:\work\dreamgaussian\gs_renderer.py", line 713, in initialize
    self.gaussians.load_ply(input)
  File "D:\work\dreamgaussian\gs_renderer.py", line 438, in load_ply
    assert len(extra_f_names)==3*(self.max_sh_degree + 1) ** 2 - 3
AssertionError

What should I do?

From the code, the sh_degree should be 3 for personal given .ply, but need to be 0 for DreamGaussian trained name_model.ply. For the former one, the mesh quality is very bad, can not see what it is...

WWmore avatar Nov 02 '23 09:11 WWmore

@WWmore The visualize command could work with sh_degree = 0. But I don't know how to generate a mesh. Once I run this command python main.py --config configs/image.yaml load=point_cloud.ply, got an error:

Traceback (most recent call last):
  File "/dreamgaussian/main.py", line 882, in <module>
    gui.train(opt.iters)
  File "/dreamgaussian/main.py", line 858, in train
    self.train_step()
  File "/dreamgaussian/main.py", line 237, in train_step
    loss.backward()
AttributeError: 'int' object has no attribute 'backward'

hodakagoto avatar Nov 02 '23 18:11 hodakagoto

@hodakagoto I think we can not train it (since the loss==0 here), but directly extract_mesh to get a mesh. I tried one example in the GUI window as seen in my note here https://github.com/WWmore/dreamgaussian. Unfortunately, the mesh quality is very bad. And I am also trying to figure out how to get a good mesh with nice texture from given Gaussian Splatting .ply. Maybe the authors or others can solve such problem easier and sooner. Looking forwards to the post.

WWmore avatar Nov 02 '23 18:11 WWmore

/dc2/dreamgaussian$ python main.py --config configs/image.yaml load=/dc2/SuGaR/output/0001_matting_blackbg/point_cloud/iteration_7000/point_cloud.ply Number of points at loading : 81269 Traceback (most recent call last): File "/dc2/dreamgaussian/main.py", line 921, in gui = GUI(opt) File "/dc2/dreamgaussian/main.py", line 86, in init self.renderer.initialize(self.opt.load) File "/dc2/dreamgaussian/gs_renderer.py", line 715, in initialize self.gaussians.load_ply(input) File "/dc2/dreamgaussian/gs_renderer.py", line 438, in load_ply assert len(extra_f_names)==3*(self.max_sh_degree + 1) ** 2 - 3 AssertionError

same issue here!!!

yangqing-yq avatar Feb 19 '24 07:02 yangqing-yq

@hodakagoto I think we can not train it (since the loss==0 here), but directly extract_mesh to get a mesh. I tried one example in the GUI window as seen in my note here https://github.com/WWmore/dreamgaussian. Unfortunately, the mesh quality is very bad. And I am also trying to figure out how to get a good mesh with nice texture from given Gaussian Splatting .ply. Maybe the authors or others can solve such problem easier and sooner. Looking forwards to the post.

老哥,你明白model.ply对于导出obj有什么作用了吗,在哪调用model.ply了

hxj2580 avatar Apr 22 '24 03:04 hxj2580

AttributeError: 'int' object has no attribute 'backward' How to solve the problem?

hxj2580 avatar Apr 23 '24 03:04 hxj2580