pytholic / PCD_Registration_ReAgent

Point cloud registration with reinforcement learning. Not my work, I just modified it for my own data.
MIT License
1 stars 0 forks source link

Documentation and type of data #1

Closed Elameri closed 2 years ago

Elameri commented 2 years ago

Hey! Thank you for you repository, and great work converting ReAgent code to notebooks, I wanted to know if there is any documentation on what you did: the structure + the new visualisation in Open3D ? and what type of input data you used ?

pytholic commented 2 years ago

@Elameri Hi! I don't have proper documentation for this but I will try to answer as clearly as I can.

1) So basically my dataset was ".obj" files (wavefront objects). Since it is different from the datasets used in the original work, I had to write a new data loader for my data.

I followed the modelnet40 dataloader example in the provided 'dataset.py' script, and wrote it for my own data.

https://github.com/rajahaseeb147/PCD_Registration_ReAgent/blob/main/dataset_custom.ipynb

Main changes were in the 'get_item' function where I change paths according to my folder structures (since I am loading data directly from .obj files and not from h5 files). I use open3d to read data as mesh and convert it to numpy array (x, y, z). Also, I append same label i.e. 0 for each data since I only have one category.

I ran both codes i.e. modelnet40 and mine side-by-side and made sure that the final output looks exactly same. Take a look at:

https://github.com/rajahaseeb147/PCD_Registration_ReAgent/blob/main/dataset_custom.ipynb

2) Then for the visualization, I wanted some 3d visualization. First I tried with matplotlib, but I did not like the results. Then I modified the original visualization script to work with open3d:

https://github.com/rajahaseeb147/PCD_Registration_ReAgent/blob/main/utility/visualization_open3d.py

I removed unnecessary stuff and simply converted the generated point clouds in the eval.py script to open3d vectors like:

pcd_src = o3d.geometry.PointCloud() pcd_src.points = o3d.utility.Vector3dVector(source_temp)

and then just simply plotted them.

Hope it helps. Let me know :)

Elameri commented 2 years ago

Hi @rajahaseeb147, thank you for your detailed answer, this is almost an exhaustive documentation ! it helps me a lot. I will close the issue

pytholic commented 2 years ago

@Elameri Glad that it helped :)