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.0.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.0.0
File Size Uploaded Provenance Actions
pointtree-2.0.0.tar.gz 158.2 kB Without provenance Details for pointtree-2.0.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pointtree 2.0.0
File Actions
pointtree-2.0.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for pointtree-2.0.0-cp314-cp314-win_amd64.whl
pointtree-2.0.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.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pointtree-2.0.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.0.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
pointtree-2.0.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for pointtree-2.0.0-cp314-cp314-macosx_11_0_arm64.whl
pointtree-2.0.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pointtree-2.0.0-cp313-cp313-win_amd64.whl
pointtree-2.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for pointtree-2.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pointtree-2.0.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.0.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
pointtree-2.0.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for pointtree-2.0.0-cp313-cp313-macosx_11_0_arm64.whl
pointtree-2.0.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pointtree-2.0.0-cp312-cp312-win_amd64.whl
pointtree-2.0.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.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pointtree-2.0.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.0.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
pointtree-2.0.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for pointtree-2.0.0-cp312-cp312-macosx_11_0_arm64.whl
pointtree-2.0.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pointtree-2.0.0-cp311-cp311-win_amd64.whl
pointtree-2.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for pointtree-2.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
pointtree-2.0.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.0.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
pointtree-2.0.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for pointtree-2.0.0-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 14.7 MB

Release files / pointtree-2.0.0.tar.gz

Download URL pointtree-2.0.0.tar.gz
Size 158.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d0563b0deb5319e0b929433bdb80cebd101879dd7175925fe32a67dca5707d72
BLAKE2b-256 checksum
How to use checksums
c92caa63d36b68a5b8cb1468c84c1f46657f88ca3974dd6f26b11be209d5a1bf
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.0.0-cp314-cp314-win_amd64.whl

Download URL pointtree-2.0.0-cp314-cp314-win_amd64.whl
Size 1.0 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
7a0f7ffb8ab8a0f2812636c5a9448d45742a43b06b8cf9032c33a45193d6701a
BLAKE2b-256 checksum
How to use checksums
58da233767d5cbeb2170ddf23ab6a897e2b81b820c571897e3d80c44932b8190
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.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pointtree-2.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 786.2 kB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9c3a097031eb0b32f004ccd7c7c00b6135688cd7df2847d1b12dc6217687f439
BLAKE2b-256 checksum
How to use checksums
9235219f50f6a6e26c0a6fc7e49dc5f1e9504a9645d7a2f978713fb56fb9b53d
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.0.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pointtree-2.0.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 723.3 kB
Tags CPython 3.14 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
2ca6237dd4219415ec398548cf248e1f6555cfac7e2d78688ad5cd1fd35352f9
BLAKE2b-256 checksum
How to use checksums
c82ea105a20de1e87c1bafb2baaf428b33536151d8ae9a27718f3334e1878e12
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.0.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL pointtree-2.0.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
afa323afcf0053d2cd1ae2c10397c85387dcfd7334a0c5029ef99e6fd901bd7f
BLAKE2b-256 checksum
How to use checksums
bbf11671b58f9933562b8d1250f1f3054df96011a2772d6cdc12db3775ef98fe
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.0.0-cp313-cp313-win_amd64.whl

Download URL pointtree-2.0.0-cp313-cp313-win_amd64.whl
Size 980.9 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
b35cc4c7accdcba1805f186d6a2a4a209443375231802adceea86757c0919aca
BLAKE2b-256 checksum
How to use checksums
c339ff3e21d941d33cf1d9636a3dfef4ba75c96a08556d827dbf5b8bda88af89
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.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pointtree-2.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 785.7 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
02bb93c4afa72b32e1ee5f73cf43567ed19a55d65bd3a22530376a7555f4dc42
BLAKE2b-256 checksum
How to use checksums
f6401e51872b616b13761c7fd07a3bfdcb223299a4fbda6939755a1434e170cd
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.0.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pointtree-2.0.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 721.9 kB
Tags CPython 3.13 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
b7e24196946380a4c826aed4602b07f6c37732a5977a4170ba7645e51e27a492
BLAKE2b-256 checksum
How to use checksums
b642dc44efcaf6dafbbf0de2e424841d077c7225e494b24eed126648788144ac
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.0.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL pointtree-2.0.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
bd28fc8c1d0837bca1e8598735652de7a3cee76ed26c7b65b50ff2656a02158b
BLAKE2b-256 checksum
How to use checksums
f16302dfeaad3c76621477f977da3ce5236b2c48c4a9d8de4dec129ccf7a94ce
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.0.0-cp312-cp312-win_amd64.whl

Download URL pointtree-2.0.0-cp312-cp312-win_amd64.whl
Size 981.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
ddf05dc3d1171849c42d79bd36d316f8aca1bc2872b7c01aa17ab69a8b39dedb
BLAKE2b-256 checksum
How to use checksums
55cb9e5e1ddfb01d256fff0bf0066fcdbd1aa12200d55b88ac48088ec62fbdd2
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.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pointtree-2.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 786.2 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f89dabbf8e2115cfcb22d2f825f641f57f3d88238a506d724a7499e31fdb6612
BLAKE2b-256 checksum
How to use checksums
4c2827f00892459a1c9352e2371fbe13f8c4555ba251399b95d4e836cc508009
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.0.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pointtree-2.0.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 722.1 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
cedb66943e0eeb2caddb927ebee64e7b25f901256a1f5d0b02d7a18a788f92c8
BLAKE2b-256 checksum
How to use checksums
fe38df717665ca6700619a2ac577a8128e2903e4caae51f2f65296e1e9791c10
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.0.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL pointtree-2.0.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
e9ce4080fb0244aacd2fbed7819ba96b9ceec9030436c82693b3f55090099c5c
BLAKE2b-256 checksum
How to use checksums
7245aa3ae74dfda0d78343850d9e77b5e634d7ac0506e06434b5d0f82fd9cd28
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.0.0-cp311-cp311-win_amd64.whl

Download URL pointtree-2.0.0-cp311-cp311-win_amd64.whl
Size 977.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
1bd5921d95939f932cfbca2164edd55c2085d8e35158e64fe98be62a6fab14b6
BLAKE2b-256 checksum
How to use checksums
38d4cf76a95074a24be57f9eb8942fe8282b9cbfb18024c929e0ff7b7c86e079
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.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pointtree-2.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 788.7 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0a79c57dcd761531e98879aec2969b3fd20fb208e79526912f0c530cf833d2d0
BLAKE2b-256 checksum
How to use checksums
1a262ad9a9e405f5c2121d95f172f83e03d81879cad2492dddef3e79e1df739b
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.0.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL pointtree-2.0.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 722.6 kB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
d60054b0b85753bd4827e5c5f1540e74aa3a80993d9a5141f84d81729a31bb1a
BLAKE2b-256 checksum
How to use checksums
bcf46c803bee281f2584d4374cd8215abad3a04f6ed1ad3b3c65f9fcdf85384a
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.0.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL pointtree-2.0.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
bf542cbe4bf56556ccd9d7c9253d11a3207b4fc9910c1552d5e02e87bcfa3e29
BLAKE2b-256 checksum
How to use checksums
e451f3fd4c9ff87fae939f394a92a8e88c299f20cc00529e4dd53a6d6a3060e2
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.0.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