Skip to main content

Community-maintained modern fork of Torch Points3D

Project description

Torch Points3D Modern

Torch Points3D Modern is a community-maintained modernization of Torch Points3D. It keeps the original task structure and YAML model catalogue while targeting current Python, PyTorch, CUDA, PyTorch Geometric, Hydra, and NumPy releases.

Status: 2.0.0a1 is an alpha release. This project is an independent fork and is not an official release from the original Torch Points3D maintainers. Validate accuracy on your own datasets before production use.

The base installation runs on CPU and NVIDIA CUDA without compiling custom point-cloud extensions. Compatible optional accelerators are detected at runtime; portable PyTorch implementations remain available as a fallback.

Supported environment

  • Python 3.10–3.12
  • PyTorch 2.4 or newer
  • PyTorch Geometric 2.5 or newer
  • CPU-only execution or NVIDIA CUDA
  • Windows, Linux, and macOS where the required PyTorch packages are available

The package distribution is named torch-points3d-modern, while the Python import remains compatible with upstream:

import torch_points3d

print(torch_points3d.__version__)

Model catalogue

All 90 executable configurations in the modern catalogue are covered by deterministic synthetic forward, loss, and backward validation.

Task Configurations Main families
Semantic segmentation 53 PointNet, PointNet++, PointCNN, RandLA-Net, KPConv, RSConv, PPNet, PVCNN, SparseConv3D, Minkowski/Res16 U-Net, MS-SVConv
Point-cloud registration 27 PointNet++, MiniPointNet, KPConv, SparseConv3D, Minkowski/Res16 U-Net, MS-SVConv
3D object detection 8 VoteNet with PointNet++, KPConv, RSConv, and sparse U-Net backbones
Panoptic segmentation 2 PointGroup and PointGroup-PAPER

List the models installed in the current environment:

tp3d-models
tp3d-models --task segmentation
tp3d-models --json

Install from GitHub

1. Clone the repository

These commands will work after this repository has been published at the URL declared in pyproject.toml:

git clone https://github.com/Alexandre77777/torch-points3d-modern.git
cd torch-points3d-modern

2. Create and activate a virtual environment

Linux or macOS:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip

Windows PowerShell:

py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip

3. Install PyTorch

For NVIDIA GPU use, first install the PyTorch build recommended for your driver and CUDA environment by the official PyTorch installation selector. CPU users can allow the next command to install the default compatible PyTorch build.

4. Install Torch Points3D Modern

Editable installation for normal development and local use:

python -m pip install -e .

Install LAS plus compressed LAZ support:

python -m pip install -e ".[compression]"

Verify the installation and the selected CPU/CUDA backends:

tp3d-doctor
tp3d-models --task segmentation

requirements.txt is a small wrapper around the canonical pyproject.toml dependencies and also enables LAZ compression:

python -m pip install -r requirements.txt

Install from PyPI

After version 2.0.0a1 has been published to PyPI:

python -m venv .venv
source .venv/bin/activate              # Windows PowerShell: .\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install "torch-points3d-modern[compression]"
tp3d-doctor

For a specific NVIDIA CUDA build, install PyTorch from the official selector before installing torch-points3d-modern.

Run a model on CPU or CUDA

This complete example creates PointNet, automatically selects CUDA when it is available, and performs inference on synthetic point features. input_channels is the number of channels in data.x; XYZ coordinates are supplied separately in data.pos.

import torch
from torch_geometric.data import Data

from torch_points3d.zoo import create_model

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

model = create_model(
    task="segmentation",
    name="PointNet",
    family="pointnet",
    input_channels=4,
    num_classes=4,
).to(device).eval()

data = Data(
    pos=torch.randn(32, 3),
    x=torch.randn(32, 4),
    batch=torch.zeros(32, dtype=torch.long),
)
model.set_input(data, device)

with torch.inference_mode():
    logits = model()

print(f"device={logits.device}, shape={tuple(logits.shape)}")

Real datasets still require task-specific preprocessing. Dense networks expect pos[B, N, 3] and x[B, N, C]; PyG networks use concatenated pos[N, 3], x[N, C], and batch[N]; sparse models additionally use integer voxel coordinates in coords[N, 3].

Optional dependencies

python -m pip install -e ".[compression]"     # LAZ through lazrs; LAS uses laspy
python -m pip install -e ".[training]"        # TensorBoard, W&B, metric learning
python -m pip install -e ".[visualization]"   # Open3D and PyVista
python -m pip install -e ".[acceleration]"    # Numba acceleration where supported
python -m pip install -e ".[dev]"             # tests, linting, and package builds

Training and evaluation with Hydra

The original configuration-oriented workflow remains available:

tp3d-train \
  task=segmentation \
  models=segmentation/randlanet \
  model_name=Randlanet_Conv \
  data=segmentation/s3dis

tp3d-eval task=segmentation checkpoint_dir=/path/to/checkpoint

On Windows PowerShell, enter the command on one line or replace each Bash \ line continuation with PowerShell's backtick. The root train.py and eval.py files remain compatibility wrappers.

Point-operation backends

Mode Availability Purpose
portable Always installed Pure PyTorch CPU/CUDA implementation without compilation
pyg Compatible pyg-lib wheel Accelerated k-NN, radius search, and farthest-point sampling
auto Default Uses available accelerated operations and otherwise falls back to portable

Select the backend before importing models:

export TP3D_POINT_OPS_BACKEND=portable

Windows PowerShell:

$env:TP3D_POINT_OPS_BACKEND = "portable"

Inspect or install an ABI-compatible optional accelerator:

tp3d-doctor --json
python scripts/install_pyg_acceleration.py --dry-run
python scripts/install_pyg_acceleration.py

pyg-lib is deliberately not a mandatory dependency because its wheel must match the installed Python, PyTorch, and CUDA versions.

Sparse-convolution backends

Backend Availability Notes
native Always installed Portable active-voxel PyTorch reference backend for CPU/CUDA
torchsparse Optional Used when a compatible TorchSparse installation is present
minkowski Optional Used when a compatible MinkowskiEngine installation is present
auto Recommended interface Selects an available accelerator and can fall back to native
from torch_points3d.modules.SparseConv3d import nn as sparse_nn

print(sparse_nn.available_backends())
sparse_nn.set_backend("auto")

The native backend is the portability and correctness reference. Specialized sparse engines may be faster on large scenes and should be benchmarked for the target workload.

Validation

Fast development checks:

python -m unittest discover -s test/modern -v
PYTHONPATH=test python -m unittest -v test.test_api test.test_model_checkpoint
python scripts/validate_model_catalogue.py --smoke

Windows PowerShell equivalent for the legacy tests:

$env:PYTHONPATH = "test"
python -m unittest -v test.test_api test.test_model_checkpoint

Full catalogue validation on both execution paths:

python scripts/validate_model_catalogue.py --device cpu --output reports/catalogue-cpu.json
python scripts/validate_model_catalogue.py --device cuda --output reports/catalogue-cuda.json

Without --device, the validator selects CUDA when available and otherwise uses CPU. The synthetic suite checks program and architecture contracts, but it does not replace retraining and benchmark evaluation on real datasets. Corrected bugs and different parallel-reduction orders mean that bitwise identity with legacy extension kernels is not promised.

Build and inspect release artifacts:

python -m build
python -m twine check --strict dist/*

See CHANGELOG.md, the migration guide, and the model validation matrix for detailed compatibility information.

Upstream sources and model attribution

This repository is derived from torch-points3d/torch-points3d, originally developed by Thomas Chaton, Nicolas Chaulet, and contributors. It also contains adaptations based on the publications and implementations below:

More specific source references are retained in model configuration files, module docstrings, and the model validation matrix. When publishing research, cite the original Torch Points3D paper and the papers for the models and datasets actually used.

@inproceedings{tp3d,
  title        = {Torch-Points3D: A Modular Multi-Task Framework for Reproducible Deep Learning on 3D Point Clouds},
  author       = {Chaton, Thomas and Chaulet, Nicolas and Horache, Sofiane and Landrieu, Loic},
  booktitle    = {2020 International Conference on 3D Vision (3DV)},
  year         = {2020},
  organization = {IEEE},
  url          = {https://github.com/torch-points3d/torch-points3d}
}

License

Torch Points3D Modern is distributed under the BSD 3-Clause License inherited from the upstream project. The original copyright notice, license conditions, and disclaimer are preserved. See the attribution notice for the independent-maintenance disclaimer.

Redistributions must retain the copyright notice, license conditions, and disclaimer as required by BSD-3-Clause. The names of Principia Labs Ltd and the upstream contributors may not be used to endorse this fork without prior written permission.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch_points3d_modern-2.0.0a1.tar.gz (351.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torch_points3d_modern-2.0.0a1-py3-none-any.whl (457.1 kB view details)

Uploaded Python 3

File details

Details for the file torch_points3d_modern-2.0.0a1.tar.gz.

File metadata

  • Download URL: torch_points3d_modern-2.0.0a1.tar.gz
  • Upload date:
  • Size: 351.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for torch_points3d_modern-2.0.0a1.tar.gz
Algorithm Hash digest
SHA256 0d5f13f731bee3f9d04d8743e360b58cc10ebdda7ed0cc832617803e26975ae3
MD5 b27ceff76866be3863b69753e0a08896
BLAKE2b-256 2a1974864dfc8b5d2ad82eddc7ef700bcddeced0915925cc07228b983f37d2ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_points3d_modern-2.0.0a1.tar.gz:

Publisher: pypi_publish.yaml on Alexandre77777/torch-points3d-modern

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_points3d_modern-2.0.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for torch_points3d_modern-2.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 1885184b72e20f45a16409c528758635e332988a3a5d01075b212cce5a26442e
MD5 a8132a92a34808d5ee4dfae39c128e7d
BLAKE2b-256 9c6c0a49847a7cfc72ccaf1058e25003fe762120237d0decb10d15082510b795

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_points3d_modern-2.0.0a1-py3-none-any.whl:

Publisher: pypi_publish.yaml on Alexandre77777/torch-points3d-modern

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page