Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty skeleton when running example #23

Open
benjaminralex opened this issue Mar 1, 2024 · 1 comment
Open

Empty skeleton when running example #23

benjaminralex opened this issue Mar 1, 2024 · 1 comment

Comments

@benjaminralex
Copy link

benjaminralex commented Mar 1, 2024

Hello,

When running the following example:

`import open3d as o3d
import numpy as np

from pc_skeletor import Dataset

downloader = Dataset()
trunk_pcd_path, branch_pcd_path = downloader.download_semantic_tree_dataset()

pcd_trunk = o3d.io.read_point_cloud(trunk_pcd_path)
pcd_branch = o3d.io.read_point_cloud(branch_pcd_path)
pcd = pcd_trunk + pcd_branch
`

`from pc_skeletor import LBC

lbc = LBC(point_cloud=pcd,
down_sample=0.008)
lbc.extract_skeleton()
lbc.extract_topology()
lbc.visualize()
lbc.show_graph(lbc.skeleton_graph)
lbc.show_graph(lbc.topology_graph)
lbc.save('./output')
lbc.animate(init_rot=np.asarray([[1, 0, 0], [0, 0, 1], [0, 1, 0]]),
steps=300,
output='./output')
`

I get these errors:

lbc.extract_topology() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/pc-skeletor/pc_skeletor/laplacian.py", line 282, in extract_topology self.skeleton = self.contracted_point_cloud.farthest_point_down_sample(num_samples=self.fps_points) AttributeError: 'open3d.cpu.pybind.geometry.PointCloud' object has no attribute 'farthest_point_down_sample

lbc.show_graph(lbc.skeleton_graph) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/pc-skeletor/pc_skeletor/base.py", line 59, in show_graph nx.draw_networkx(G=graph, pos=np.asarray(pos)[:, [0, 2]]) IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Are there any fixes for these?

Thanks!

@meyerls
Copy link
Owner

meyerls commented Mar 12, 2024

My first guess is that the open3d version is not correct (my bad that I did not specify any version). Please try pip install open3d==0.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants