Skip to content

PyTorch PointCloud

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.

Object classificationpointnet2-ssg.modelnet40.xu-yan
Part segmentationpointnext-sm.shapenetpart.openpoints
Indoor segmentation / detectionptv3-base.scannet20.pointcept
Outdoor segmentation / detectionspvcnn-119gmacs.semantickitti.mit-han-lab
second.kitti.openpcdet
Large scale segmentationutonia-lp.scannet20.pointcept
Feature extractionsonata-lp.scannet20.fair

In 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

  • Get Started

    Install, run your first model, and learn the library's conventions.

  • Models

    PointNet, PointNet++, RandLA-Net, KPConv, PointNeXt, OctFormer, Point Transformer, SPVCNN, and more.

  • Datasets

    ModelNet, ScanNet, S3DIS, ShapeNetPart, ScanObjectNN, SemanticKITTI, Semantic3D, and more.

  • Transforms

    Composable, non-mutating dict transforms inspired by MONAI.

  • Tutorials

    Ready-to-use notebooks, from a first classification to survey-scale inference.

  • API Reference

    Auto-generated reference for every public class and function.

  • Source

    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.