pythonpython-3.xopen3d

How to download the TestData dataset of open3d python


I have installed open3d in Raspberry Pi 4 using the documentation: Command: pip3 install open3d

I can successfully import open3d in a Python program. But if I run the program from the tutorial:

import numpy as np
import open3d as o3d

if __name__ == "__main__":
    print("Load a ply point cloud, print it, and render it")
    pcd = o3d.io.read_point_cloud("../../TestData/fragment.ply")
    print(pcd)
    print(np.asarray(pcd.points))
    o3d.visualization.draw_geometries([pcd])

It gives error:

Load a ply point cloud, print it, and render it
RPly: Unable to open file
[Open3D WARNING] Read PLY failed: unable to open file: ../../TestData/fragment.ply
PointCloud with 0 points.
[]
[Open3D WARNING] The number of points is 0 when creating axis-aligned bounding box.

It looks like the TestData files are not downloaded.

So how can I download the TestData files?


Solution

  • The latest version of Open3D downloads all data needed in o3d.data module. Hence, just use latest version docs available here.

    P.S. Note that URL should have latest keyword in it for the most recent version docs:

    https://www.open3d.org/docs/latest/tutorial/geometry/pointcloud.html

    Also, notice the theme change between the old version and the new version. The new version uses furo theme which provides light/dark mode along with a right pane for easier view of class methods. For example: See https://www.open3d.org/docs/latest/python_api/open3d.geometry.TriangleMesh.html#open3d.geometry.TriangleMesh.