PyTorch PointCloud¶

A PyTorch library for deep learning on point clouds. Models for classification, segmentation, and detection, pretrained-weight registry, and composable transforms in the style of
timm and
torch_geometric.
pointnet2-ssg.modelnet40.xu-yanpointnext-sm.shapenetpart.openpointsptv3-base.scannet20.pointceptspvcnn-119gmacs.semantickitti.mit-han-labsecond.kitti.openpcdetutonia-lp.scannet20.pointceptsonata-lp.scannet20.fairIn a few lines¶
The example reads one object of the ModelNet40 test set, downloaded on first use.
import torch
import torch_pointcloud as tp
from torch_pointcloud.datasets import ModelNetNormalResampled
from torch_pointcloud.utils.data import collate
# Load pretrained checkpoint.
model, info = tp.create_model(
"pointnet2-ssg.modelnet40.xu-yan",
task="classification",
pretrained=True,
return_info=True,
)
model = model.eval()
# Get associated transform pipeline.
transform = info["transform"]
# Load a preprocessed sample and collate in packed format
dataset = ModelNetNormalResampled(root="data", variant="40", train=False, download=True, transform=transform)
data = collate([dataset[0]])
# Run inference
with torch.no_grad():
logits = model(None, data["pos"], data["batch"])
print(f"Prediction: {logits.argmax().item()}")
# Prediction: 0
What's inside¶
-
Install, run your first model, and learn the library's conventions.
-
PointNet, PointNet++, RandLA-Net, KPConv, PointNeXt, OctFormer, Point Transformer, SPVCNN, and more.
-
ModelNet, ScanNet, S3DIS, ShapeNetPart, ScanObjectNN, SemanticKITTI, Semantic3D, and more.
-
Composable, non-mutating dict transforms inspired by MONAI.
-
Ready-to-use notebooks, from a first classification to survey-scale inference.
-
Auto-generated reference for every public class and function.
-
Browse the source, file issues, or contribute.
License¶
Apache 2.0. See LICENSE.
Pretrained weights and adapted code keep the license of their source, and some checkpoints are restricted to non-commercial use. See THIRD_PARTY_NOTICES.md.