AllenXiangX / SnowflakeNet

(TPAMI 2023) Snowflake Point Deconvolution for Point Cloud Completion and Generation with Skip-Transformer
MIT License
142 stars 16 forks source link

Testing on my point cloud #31

Open FSet89 opened 3 months ago

FSet89 commented 3 months ago

I want to test the completion model on my point cloud. I load it as a Nx3 array where N~9000 and I feed it to the ckpt-best-shapenet34_21-cd_l2.pth model checkpoint. The output is a list of 4 tensors with shape: torch.Size([1, 256, 3]) torch.Size([1, 512, 3]) torch.Size([1, 2048, 3]) torch.Size([1, 8192, 3]) I'm a bit confused here. How do I recover the predicted cloud? I tried to switch C and N axes like suggested in another issue but I get a CUDA error:

CUDA kernel failed : invalid configuration argument void gather_points_kernel_wrapper(int, int, int, int, const float, const int, float*) at L:29 in /home/x/SnowflakeNet/models/pointnet2_ops_lib/pointnet2_ops/_ext-src/src/sampling_gpu.cu

BowenTan02 commented 3 months ago

Please refer to this issue https://github.com/AllenXiangX/SnowflakeNet/issues/23 After the prediction is generated, you can try:

completed_pc = open3d.geometry.PointCloud()
# result is a list of tensors
completed_point_cloud = completed_point_cloud[-1].cpu().numpy()
# convert to float64 array
completed_point_cloud = completed_point_cloud.astype(np.float64)
# remove first dimension
completed_point_cloud = np.squeeze(completed_point_cloud)
print("Predicted Shape", completed_point_cloud.shape)
completed_pc.points = open3d.utility.Vector3dVector(completed_point_cloud)

where completed_point_cloud is the model output after running Mustafa's function complete_point_cloud in his script. I hope this helps!