isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.22k stars 2.28k forks source link

`read_point_cloud` from buffer (not filename string) #1146

Open sammo2828 opened 5 years ago

sammo2828 commented 5 years ago

Point cloud files can be loaded using filename, e.g.:

pcd = open3d.io.read_point_cloud("pointcloud.ply")

Is there a way to load from a file that has already been read into a buffer? E.g. something like this:

with open("pointcloud.ply", "b") as f:
   buffer = f.read()
pcd = open3d.io.read_point_cloud(buffer, format="ply")

My use case is the ply files are read from a zip archive so I don't want to save individual ply files to disk so that open3d can load them.

yxlao commented 5 years ago

that's not possible currently, read_point_cloud is bind to open3d::io::ReadPointCloud C++ function, which takes the filename as argument

hamaney commented 4 years ago

that would be cool to have as it boosts the performance!!

ManuelZ commented 4 years ago

+1

germanros1987 commented 4 years ago

@sammo2828 in order to make that change in a consistent fashion we would have to update the entire IO module. I personally don't think it's worth the investment, but if you see the value we will happily accept a good PR.

ruisebastiao commented 3 years ago

+1

lfxx commented 2 years ago

Quite need this feature as when we use Open3D in some online stream service,the pcd we receive is buffer not file.Read directly from buffer could save lots of time.

sgolodetz-vm commented 1 year ago

+1