Skip to content

Commit

Permalink
[Fix] Replace Open3D with PyntCloud for saving point cloud to files
Browse files Browse the repository at this point in the history
change package for saving point cloud.
  • Loading branch information
Wuziyi616 authored Apr 11, 2023
2 parents d874cb2 + 2fb9bed commit 224d922
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
5 changes: 0 additions & 5 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,3 @@ Please downgrade to PyTorch 1.10 if necessary.
Try `pip install setuptools==59.5.0`.
See this [issue](https://github.com/pytorch/pytorch/issues/69894#issuecomment-1080635462).

3. `OSError: /lib/x86_64-linux-gnu/libm.so.6: version 'GLIBC_2.27' not found`

This is an error when importing `open3d`.
Please downgrade it to 0.9 by `pip install open3d==0.9`.
According to this [issue](https://github.com/isl-org/Open3D/issues/1307), this is because the latest `open3d` requires `GLIBC_2.27` file, which only exists in Ubuntu 18.04 (and later versions), not in Ubuntu 16.04.
9 changes: 5 additions & 4 deletions multi_part_assembly/utils/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import copy
import pickle
import numpy as np
import open3d as o3d
import pandas as pd
from pyntcloud import PyntCloud

import torch.nn as nn
from torch.nn import LayerNorm, GroupNorm
Expand Down Expand Up @@ -40,9 +41,9 @@ def save_pc(pc, file):
pc (np.ndarray): [N, 3]
file (str)
"""
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(pc)
o3d.io.write_point_cloud(file, pcd)
pcd_df = pd.DataFrame(data=pc, columns=['x', 'y', 'z'])
pcd_cloud = PyntCloud(pcd_df)
pcd_cloud.to_file(file)


def colorize_part_pc(part_pc, colors):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from setuptools import setup, find_packages

requirements = [
'numpy', 'pyyaml', 'trimesh', 'wandb', 'torch', 'pytorch_lightning',
'tqdm', 'yacs', 'open3d', 'pytorch3d', 'einops'
'numpy', 'pandas', 'pyyaml', 'trimesh', 'wandb', 'torch', 'pytorch_lightning',
'tqdm', 'yacs', 'pyntcloud', 'pytorch3d', 'einops'
]


Expand Down

0 comments on commit 224d922

Please sign in to comment.