Skip to main content
pointtree

A Python Package for Tree Instance Segmentation in 3D Point Clouds.

pypi-image License: MIT CI coverage PyPI - Python Version

The package contains implementation of the following tree instance segmentation algorithms:

  • TreeXAlgorithm
  • CoarseToFineAlgorithm

It contains the official source code of the following papers:

Package Documentation

The documentation of our package is available here.

Installation

The installation steps are detailed in the documentation. A minimal example is shown below:

python -m pip install torch==2.10.0
python -m  pip install torch-scatter torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
python -m pip install pointtree

How To Use the Package

The TreeXAlgorithm segments individual tree instances from point clouds of forest areas. It assumes that the input point cloud contains only terrain and vegetation points. If your data includes other objects (e.g., man-made structures), the algorithm can still be applied, but its accuracy may be reduced.

1. Creating an Algorithm Instance

To get started, create an instance of the TreeXAlgorithm class. All parameters have default values, but you can override them by passing keyword arguments to the constructor. For a complete list of parameters and their descriptions, see the documentation.

from pointtree.instance_segmentation import TreeXAlgorithm

# Optional: specify a folder for saving visualizations of intermediate results
# Note: generating visualizations slows down processing and is recommended only for small datasets
visualization_folder = "./visualizations"  # or set to None to disable

algorithm = TreeXAlgorithm(visualization_folder=visualization_folder)

2. Using Presets

We provide presets tailored to typical point cloud characteristics from different laser scanning modalities: terrestrial (TLS), and UAV-borne (ULS). These presets simplify setup for common use cases.

from pointtree.instance_segmentation import TreeXPresetTLS, TreeXPresetULS

preset = TreeXPresetTLS()  # or use TreeXPresetULS()
algorithm = TreeXAlgorithm(**preset)

3. Running the Algorithm

The algorithm requires a numpy array of shape (n_points, 3) as input, containing the xyz-coordinates of the point cloud. If available, you can also pass reflection intensity values which may improve segmentation accuracy.

The algorithm returns a tuple of three numpy arrays:

  • instance IDs: an array of instance labels (points that belong to the same tree have the same ID, points not belonging to any tree have the ID -1),
  • trunk positions: 2D coordinates of the detected tree trunks at breast height
  • trunk diameters: diameters of the detected trunks at breast height.
from pointtorch import read

# Load your point cloud (supports .txt, .csv, .las, .laz, .ply)
file_path = "./demo.laz"
point_cloud = read(file_path)

# Run the algorithm
instance_ids, trunk_positions, trunk_diameters = algorithm(
    point_cloud[["x", "y", "z"]].to_numpy(),
    intensities=point_cloud["intensity"].to_numpy(),
    point_cloud_id="test-point-cloud",  # Optional: Used for naming visualization / intermediate outputs
    crs="EPSG:4326"  # Optional: Used for georeferencing intermediate outputs
)

# Add results to the point cloud and save to a new file
point_cloud["instance_id"] = instance_ids
point_cloud.to("./demo_segmented.laz", columns=["x", "y", "z", "instance_id"])

How to Cite

If you use our code, please consider citing our papers:

@article{Burmeister_Tree_X_2025,
author = {Burmeister, Josafat-Mattias and Tockner, Andreas and Reder, Stefan and Engel, Markus and Richter, Rico and Mund, Jan-Peter and D{\"o}llner, J{\"u}rgen},
doi = {https://doi.org/10.48550/arXiv.2509.03633},
journal = {{arXiv} preprint},
title = {{treeX}: Unsupervised Tree Instance Segmentation in Dense Forest Point Clouds},
year = {2025}
}
@article{Burmeister_Tree_Instance_Segmentation_2024,
author = {Burmeister, Josafat-Mattias and Richter, Rico and Reder, Stefan and Mund, Jan-Peter and D{\"o}llner, J{\"u}rgen},
doi = {10.5194/isprs-annals-X-4-W5-2024-79-2024},
journal = {{ISPRS} Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences},
pages = {79--86},
title = {{Tree Instance Segmentation in Urban 3D Point Clouds Using a Coarse-to-Fine Algorithm Based on Semantic Segmentation}},
volume = {X-4/W5-2024},
year = {2024}
}

Metadata

Release files for pointtree 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pointtree 2.1.0
File Size Uploaded Provenance Actions
pointtree-2.1.0.tar.gz 165.4 kB Without provenance Details for pointtree-2.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pointtree 2.1.0
File Actions
pointtree-2.1.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for pointtree-2.1.0-cp314-cp314-win_amd64.whl
pointtree-2.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for pointtree-2.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pointtree-2.1.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for pointtree-2.1.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
pointtree-2.1.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for pointtree-2.1.0-cp314-cp314-macosx_11_0_arm64.whl
pointtree-2.1.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pointtree-2.1.0-cp313-cp313-win_amd64.whl
pointtree-2.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for pointtree-2.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pointtree-2.1.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for pointtree-2.1.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
pointtree-2.1.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for pointtree-2.1.0-cp313-cp313-macosx_11_0_arm64.whl
pointtree-2.1.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pointtree-2.1.0-cp312-cp312-win_amd64.whl
pointtree-2.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for pointtree-2.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pointtree-2.1.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for pointtree-2.1.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
pointtree-2.1.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for pointtree-2.1.0-cp312-cp312-macosx_11_0_arm64.whl
pointtree-2.1.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pointtree-2.1.0-cp311-cp311-win_amd64.whl
pointtree-2.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for pointtree-2.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pointtree-2.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for pointtree-2.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
pointtree-2.1.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for pointtree-2.1.0-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 14.8 MB

Release files / pointtree-2.1.0.tar.gz

Download URL pointtree-2.1.0.tar.gz
Size 165.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2d2bca97415ad349fccf30430d73a34b6d3cf1ef0a2e32b6d8251fd15591789f
BLAKE2b-256 checksum
How to use checksums
21ed4aa6085212e1277ef831954097d5354e88a28fb502719dc2b88bc701fc21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp314-cp314-win_amd64.whl

Download URL pointtree-2.1.0-cp314-cp314-win_amd64.whl
Size 1.0 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
15a0a61b0637d265f78525fef8f022df44efa34731579232d259db4f7b2c9078
BLAKE2b-256 checksum
How to use checksums
41239eae738d123319160165b671dd1fd8c16b2741f81c06598add5a2b16812f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pointtree-2.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 787.6 kB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
17e5f908835c203f29ab638050492652e96aaac6d5791df242ad886d7665d2b7
BLAKE2b-256 checksum
How to use checksums
6cef8b42be087cfeea051a92994aaab6810fc8148c6487fbf439cd9cab28fef8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pointtree-2.1.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 724.7 kB
Tags CPython 3.14 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
c80f219beed5fb9de262a54f115f8c67499aeb32f67a6bb84b22dea844038feb
BLAKE2b-256 checksum
How to use checksums
7b50a2cd76be6adbef81e1276f9d08d6486a13f639269de40d13093f5239a693
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL pointtree-2.1.0-cp314-cp314-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ac742f15aba72a8199c8c608190fdf6bcc7d9413ee1e5a3a4a36d2557e2dbd56
BLAKE2b-256 checksum
How to use checksums
021e911eec135802ac80ff72f815e93f643998f7d3a87e8784f4bf461467176a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp313-cp313-win_amd64.whl

Download URL pointtree-2.1.0-cp313-cp313-win_amd64.whl
Size 982.3 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
8072f91706ee0bbfc26447beb878180dfc0f9ff2a81192f87ac4846d943ac4c6
BLAKE2b-256 checksum
How to use checksums
8cebd73d50487240ae49b7815d991df30f54d2addc5fcb4d981d1ebc3b2d5918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pointtree-2.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 787.0 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d42b0a55fc5b5998a1cb570a0a02dd54831b49a47253d0aae6ac53ec270a860d
BLAKE2b-256 checksum
How to use checksums
b0a0577cfe7baf8f5a2646c605b347af37d7cac0785fa37886a3fe785ceb883a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pointtree-2.1.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 723.3 kB
Tags CPython 3.13 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
cff7aed70ce95ac370c2f630c7f1b249932e010eba316a10824c19cc31ce55ac
BLAKE2b-256 checksum
How to use checksums
0a4a9d778d2e30a9c17ec41c8c04c578667905c0051e2b551ad59d9f1e128de1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL pointtree-2.1.0-cp313-cp313-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
70bed1246712c8bc24fffd3dae10821d0b5ee04354ccbcd5d996140fb15ffb63
BLAKE2b-256 checksum
How to use checksums
91e241399380fbd16450288b65e4e0173160ba3c21be0e22a28670b5e1d2d0a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp312-cp312-win_amd64.whl

Download URL pointtree-2.1.0-cp312-cp312-win_amd64.whl
Size 982.3 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
714429db1d3dcba28a785a8a696100bb94532539634323074085fa6c96fea2a7
BLAKE2b-256 checksum
How to use checksums
de206b953b01d17f822090c6b73cb125f5b2814d953d3d75625f45222d4107fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pointtree-2.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 787.5 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d78e6566b046fe89add5dc5ded7aea92906642fe1632182a741702a054c913d2
BLAKE2b-256 checksum
How to use checksums
21e6b639a2a01c89244afc50c01ac17a7a04e64d1a779e76a5fa7ee8992592e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pointtree-2.1.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 723.4 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
58490bcc879f87659d3a2e20fd851e491cdfd9059a1c756b747a2b94fabafcc3
BLAKE2b-256 checksum
How to use checksums
f76110ec9ce381898e1b232fcf44fd24e6abba7a5f210fb83a864e55de67283a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL pointtree-2.1.0-cp312-cp312-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f7fffc983251e672b92d4b334e67c3f01895883b3b8c159e1360a08d359671cf
BLAKE2b-256 checksum
How to use checksums
37d9fc1a2464a65eae54c1dcf54aea47e7566904f39192d5daa8053926a9d40b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp311-cp311-win_amd64.whl

Download URL pointtree-2.1.0-cp311-cp311-win_amd64.whl
Size 979.0 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
367a9d18850ad7baa61e2d24fc04de8ab8a373e3a65b84f76a70d32a8798fde1
BLAKE2b-256 checksum
How to use checksums
1ec80a3c10c9a29a7c9906fe736030fa6c2a355045eeb4e8d51c8945581033ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pointtree-2.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 790.1 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
69d0d7441752391910da4407d17d8b46c23026b5cec797e7a158b03ae6ef2d8c
BLAKE2b-256 checksum
How to use checksums
6a4f9a87e6ac336bc37ebe6b9b97d11690334207488ccd645fdec35f41adf6e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pointtree-2.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 724.0 kB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
4bad90600425ccd1ef3a44b231bdf1b0403ace0255efe022feec1f97ced7ecfa
BLAKE2b-256 checksum
How to use checksums
c5438e35d8746ab8c968d06636f2f88d99606a6cbde265a0aed79a7993a1cc49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pointtree-2.1.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL pointtree-2.1.0-cp311-cp311-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5d1dded4fd7466dc58f6669ff9a453d69b5ecdf1441fd19be37ccf6d716357cb
BLAKE2b-256 checksum
How to use checksums
86a0e36f50aa6cb4d360c0f4b4666abca450613cd09d63396911872ecf86f1a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for pointtree 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page