A Python Package for Tree Instance Segmentation in 3D Point Clouds.
The package contains implementation of the following tree instance segmentation algorithms:
- TreeXAlgorithm
- CoarseToFineAlgorithm
It contains the official source code of the following papers:
- TreeXAlgorithm - Burmeister, Josafat-Mattias, Tockner, Andreas, Reder, Stefan, Engel, Markus, Richter, Rico, Mund, Jan-Peter, & Döllner, Jürgen (2025). "treeX: Unsupervised Tree Instance Segmentation in Dense Forest Point Clouds." arXiv preprint arXiv:2509.03633.
- CoarseToFineAlgorithm - Burmeister, Josafat-Mattias, Richter, Rico, Reder, Stefan, Mund, Jan-Peter, & Döllner, Jürgen (2024). "Tree Instance Segmentation in Urban 3D Point Clouds Using a Coarse-to-Fine Algorithm Based on Semantic Segmentation." ISPRS Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences, 10, 79-86.
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 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pointtree-1.0.1.tar.gz | 133.5 kB | Without provenance | Details for pointtree-1.0.1.tar.gz |
Built distributions (wheels)
Total release size: 14.1 MB
Release files / pointtree-1.0.1.tar.gz
| Download URL | pointtree-1.0.1.tar.gz |
|---|---|
| Size | 133.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a53006035add711956a210d674a73bc293f54c8a8d40ab59179cbd2580152da1
|
|
BLAKE2b-256 checksum How to use checksums |
8db3b983e292e4d2b7adeaa003083d4480cfa39525a274843b9316b48d36e537
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp314-cp314-win_amd64.whl
| Download URL | pointtree-1.0.1-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 935.8 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b9d983ff85a63c30d3dc07492c4bf73947f3e1943feac47aa430afe7daa5fc54
|
|
BLAKE2b-256 checksum How to use checksums |
9024906f2de4edb5611ce7907840e953d3c6cb8118b7f9968e7c02bb8be8e8b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pointtree-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 765.8 kB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
a8bf2c680c747e93a0a726da7bbedbda7179161441955dfedb58dcb66f7b7e81
|
|
BLAKE2b-256 checksum How to use checksums |
ddce41d0a7d63243249ff1f1f10ec6234dd5dd281fb103500acbd7b778047e3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pointtree-1.0.1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 702.9 kB |
| Tags | CPython 3.14 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
793ea0393e304304846f75c49b187d3c0d5771c281913cbb54409953d258114f
|
|
BLAKE2b-256 checksum How to use checksums |
e1e92e8d5bfad053cf6d7226d1db65ee5145a47f245d0b2d9cc7009b6f266abd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | pointtree-1.0.1-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 |
b17887f588fcf9eac75660a5ef3215d50a5bd37337f7e87c908e66ac4eaf21a6
|
|
BLAKE2b-256 checksum How to use checksums |
c69b8f77ce00a4d3f9db55f294b2959415f93295e2b7448fd8ed90571046af1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp313-cp313-win_amd64.whl
| Download URL | pointtree-1.0.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 911.1 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a4f87d0a475a13e1143189d44ca2842221979c107f48c23a9365cdabdf942c16
|
|
BLAKE2b-256 checksum How to use checksums |
e7334c1b880c2b918cf3dc5f065bdc5ba70aa1504340deb6029f75a8b954e425
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pointtree-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 765.2 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f1bfd9c695c29de7f1eb757de7b4191a11b7ea62397729f8f0d4e98c55be6045
|
|
BLAKE2b-256 checksum How to use checksums |
8a1e6c04a25682ba8c20788010285b79b2780f9d9cc34a85421396215f8458e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pointtree-1.0.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 701.5 kB |
| Tags | CPython 3.13 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
49409690ec2fc3c6a39addfea3ce1e12cb54ba76ad17c52db66b8e965164a9de
|
|
BLAKE2b-256 checksum How to use checksums |
a134ee2e3a78acd82f501070986b4bead3b471226e23444bfefd397ad6a5d0fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pointtree-1.0.1-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 |
fefec9b20d94082e3d24d76e151c9a7c6130b04ab4bf724abf5d71c841d00dbf
|
|
BLAKE2b-256 checksum How to use checksums |
bcc4f49218e3eed9d69320958c9bb66fea41940e85c4287853e4a0b34c9da12a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp312-cp312-win_amd64.whl
| Download URL | pointtree-1.0.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 911.1 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1d23cb10c473c6033e508f32953347d87457a9efc5a63f5e1ad5c11844cb465f
|
|
BLAKE2b-256 checksum How to use checksums |
3bb9eebc4c0298461fc0432ddea76e17e91aa2f95e87565569813f6d732efb05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pointtree-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 765.7 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
312a4c39ea3acbd5fcc13c0f05e3fda03ef494e881701c5632fbd130bf297203
|
|
BLAKE2b-256 checksum How to use checksums |
235e8223b522cc2154210d45341c0f99c082f22aa046ca3d2559cf67eac84c7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pointtree-1.0.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 701.6 kB |
| Tags | CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
50b2109155bf185afb92c54de9f4ee27996e9495bb7249ba9f7756dfd5b9cafa
|
|
BLAKE2b-256 checksum How to use checksums |
32af16f3888bf4a875e35aa861b30cf7220687fd5349ddc98f2a0dad1a1e9d30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pointtree-1.0.1-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 |
4f0a10f1e278e904711b79553bb954a8bfba1d70b7ea858a289698001322b4be
|
|
BLAKE2b-256 checksum How to use checksums |
c4e414bf0a85a16adceca1e86a0d65e2f04352318446407bf9de4b9771b7dfa3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp311-cp311-win_amd64.whl
| Download URL | pointtree-1.0.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 908.3 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
465a9ed7da010f575a6095f0a263776ba6caacbc429dcb012e7f6e3ab2f877b5
|
|
BLAKE2b-256 checksum How to use checksums |
036efb927173d9d693b0c9e98aae15d1b0542368a63fee30dce94acf26819632
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pointtree-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 768.3 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
912c840c0f1de91a95b379f9d58b79d541986afbf3e044db0abf40a52b5085a1
|
|
BLAKE2b-256 checksum How to use checksums |
40e4dd86a0e3aebfbe62f1ae586b146355d43870fbb92343151ef04beb88d062
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pointtree-1.0.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 702.2 kB |
| Tags | CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
aae52d3ad05851c8b55fa12ede4e79df502d38e9abf569bc1518242b895c6777
|
|
BLAKE2b-256 checksum How to use checksums |
2d7f7521d5a573e458b051ebf340de224d00e72736bb6a13026efe349a4568e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pointtree-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pointtree-1.0.1-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 |
4684f56cee6e806d4b0abe8a45469f2a9bea021804ce56e2b913c561a95a483d
|
|
BLAKE2b-256 checksum How to use checksums |
54a385165a8bdbbf240fed6b20176de23e43dc774645e2f4522f71c41cd912ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for pointtree 1.0.1
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.