city-super / Scaffold-GS

[CVPR 2024 Highlight] Scaffold-GS: Structured 3D Gaussians for View-Adaptive Rendering

Home Page:https://city-super.github.io/scaffold-gs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

fanzz1208 opened this issue · comments

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

Two ways: 1. you can refer to

if ply_path is None:
ply_path = os.path.join(path, "points3d.ply")
if not os.path.exists(ply_path):
# Since this data set has no colmap data, we start with random points
num_pts = 10_000
print(f"Generating random point cloud ({num_pts})...")
# We create random points inside the bounds of the synthetic Blender scenes
xyz = np.random.random((num_pts, 3)) * 2.6 - 1.3
shs = np.random.random((num_pts, 3)) / 255.0
pcd = BasicPointCloud(points=xyz, colors=SH2RGB(shs), normals=np.zeros((num_pts, 3)))
storePly(ply_path, xyz, SH2RGB(shs) * 255)
to give a rand init during loading data;

  1. replace
    points = pcd.points[::self.ratio]
    with a rand init.

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.

To do so, you can replace

try:
xyz, rgb, _ = read_points3D_binary(bin_path)
except:
xyz, rgb, _ = read_points3D_text(txt_path)
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.

To do so, you can replace

try:
xyz, rgb, _ = read_points3D_binary(bin_path)
except:
xyz, rgb, _ = read_points3D_text(txt_path)

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?

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