octree converted point clouds errors while training
Karthik777 opened this issue · 2 comments
Hi,
I tried using unorganised point clouds and I got this error at line 70 of OctreeConvolutionMM.lua
invalid input size, self.nInputPlane=1, input:feature_size()=3
I assume it's because unorganised point clouds do not have positional information of the points and hence are 1 * numofpoints instead of height * width
So I tried I using organised point clouds, and the code errors out giving before even loading the octrees completely.
feature_size of path 1 does not match in octree_read_batch_cpu (3, 1)
Both of them are related to the feature size and input plane mismatch which pushes me to believe that I'm doing a mistake while creating the octree.
I'm using python pcl to load point clouds and I convert them into numpy arrays before using create_octree_from_cpu.
import pcl
path = "./organisedpointclouds/cloud1.pcd"
p = pcl.load(path)
xyz = cloud
features = np.ones_like(xyz)
oc_from_pcl = pyoctnet.Octree.create_from_pc(xyz, features, vx_res, vx_res, vx_res, normalize=True,
n_threads=n_threads)
for idx in range(3):
xyz[..., idx] = (xyz[..., idx] - xyz[..., idx].min()) / (xyz[..., idx].max() - xyz[..., idx].min())
xyz[..., idx] *= vx_res
oc_from_pcl = pyoctnet.Octree.create_from_pc(xyz, features, vx_res, vx_res, vx_res, normalize=False,
n_threads=n_threads)
savePath = "./octrees/octree1.oc"
oc_from_pcl.write_bin(savePath)
cloud.zip
I am not sure what you mean with organised vs. unorganised point clouds?
However, I guess you can get rid of the first error, if you use features = np.ones((1,xyz.shape[0]), dtype=np.float32)
instead of features = np.ones_like(xyz)
, given that xyz
has the right shape, ie Nx3.
It should be features = np.ones((xyz.shape[0],1), dtype=np.float32)