Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fanzz1208 opened this issue Mar 11, 2024 · 5 comments
Open

Comments

@fanzz1208
Copy link

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

@inspirelt
Copy link
Collaborator

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.

@fanzz1208
Copy link
Author

fanzz1208 commented Mar 13, 2024

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.

@inspirelt
Copy link
Collaborator

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.

@fanzz1208
Copy link
Author

fanzz1208 commented Mar 13, 2024

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?

@inspirelt
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants