Scaffold-GS icon indicating copy to clipboard operation
Scaffold-GS copied to clipboard

How to initialization with a random point cloud in my own datasets?

Open fanzz1208 opened this issue 11 months ago • 5 comments

How to initialization with a random point cloud in my own datasets?

fanzz1208 avatar Mar 11 '24 06:03 fanzz1208

Two ways: 1. you can refer to https://github.com/city-super/Scaffold-GS/blob/da97ef8257b46d51c432df0df8b62f7c3a3c1079/scene/dataset_readers.py#L307-L319 to give a rand init during loading data;

  1. replace https://github.com/city-super/Scaffold-GS/blob/da97ef8257b46d51c432df0df8b62f7c3a3c1079/scene/gaussian_model.py#L237 with a rand init.

inspirelt avatar Mar 11 '24 07:03 inspirelt

to give a rand init during loading data

So what should I do, just delete points3D.txt from the dataset? Or, how can I modify this code? my dataset is "Colmap" Because my dataset was taken by myself, the point cloud extracted using SFM performs poorly, so I want to test it with a randomly initialized point cloud.

fanzz1208 avatar Mar 13 '24 12:03 fanzz1208

To do so, you can replace https://github.com/city-super/Scaffold-GS/blob/da97ef8257b46d51c432df0df8b62f7c3a3c1079/scene/dataset_readers.py#L191-L194 with

num_pts = 100_000 
print(f"Generating random point cloud ({num_pts})...")   
xyz = np.random.random((num_pts, 3)) * 2.6 - 1.3  # adjust 2.6 and 1.3 to match your custom scene
rgb = np.random.random((num_pts, 3))

BTW, since your point cloud from Colmap is poor, I'm afraid that your pose is poor as well.

inspirelt avatar Mar 13 '24 12:03 inspirelt

To do so, you can replace

https://github.com/city-super/Scaffold-GS/blob/da97ef8257b46d51c432df0df8b62f7c3a3c1079/scene/dataset_readers.py#L191-L194

with

num_pts = 100_000 
print(f"Generating random point cloud ({num_pts})...")   
xyz = np.random.random((num_pts, 3)) * 2.6 - 1.3  # adjust 2.6 and 1.3 to match your custom scene
rgb = np.random.random((num_pts, 3))

BTW, since your point cloud from Colmap is poor, I'm afraid that your pose is poor as well.

Thank you for your answer. I still want to give it a try. The data I am using is poor, so the pose matched with colmap is very poor, and I don't know how to solve it. Do you have any good suggestions?

fanzz1208 avatar Mar 13 '24 13:03 fanzz1208

Can you obtain the gt pose through other method, rather than Comap?

inspirelt avatar Mar 14 '24 08:03 inspirelt