Search code examples
3dobject-detectiontensorflow-datasetspoint-cloud-librarypoint-clouds

3D object detection for custom objects; dataset creation


How can I create a custom dataset for 3D object detection, I want to use the "Stanford3dDataset" or "Scannet" as baseline and add my object of interest in the dataset. I have the PCD files captured from the 3D camera [Realsense] and for 3D object detection, I am using the Pointnet model.

I see the dataset has the text file as input instead of PCD or PLY format, how do I convert PLY/PCD files to text files.


Solution

  • import open3d as o3d

    import numpy as np

    Load saved point cloud

    pcd_load = o3d.io.read_point_cloud("try.ply")

    convert PointCloud to numpy array

    xyz_load = np.asarray(pcd_load.points)

    Save points into a text file

    np.savetxt('test.txt', xyz_load)`

    More information is available in the link - NumPy <-> open3d.PointCloud