📌

【解決】Open3Dでデータをダウンロードできない!

2022/12/10に公開

問題

Testing IO for point cloud ...
[Open3D INFO] Downloading https://github.com/isl-org/open3d_downloads/releases/download/20220201-data/fragment.pcd
[Open3D WARNING] Failed to download from https://github.com/isl-org/open3d_downloads/releases/download/20220201-data/fragment.pcd. Expection UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8f in position 23: invalid start byte.

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
c:\Users\PATH\22.06_pointcloud\open3d\open3d.ipynb Cell 2' in <cell line: 2>()
      1 print("Testing IO for point cloud ...")
----> 2 sample_pcd_data = o3d.data.PCDPointCloud()
      3 pcd = o3d.io.read_point_cloud(sample_pcd_data.path)
      4 print(pcd)

RuntimeError: [Open3D Error] (class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl open3d::utility::DownloadFromURL(const class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)) D:\a\Open3D\Open3D\cpp\open3d\utility\Download.cpp:192: Downloading failed from available mirrors.

解決策

ダウンロードしてからそれを指定する感じ。

print("Testing IO for point cloud ...")
# sample_pcd_data = o3d.data.PCDPointCloud()
pcd = o3d.io.read_point_cloud("fragment.pcd") # ダウンロードしたデータを利用
print(pcd)
o3d.io.write_point_cloud("copy_of_fragment.pcd", pcd)

根本的な問題は解決していない気がするけど、とりあえず対症療法はできたって感じ。

Discussion