Skip to main content

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

Project description

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}
}

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

pointtree-1.0.1.tar.gz (133.5 kB view details)

Uploaded Source

Built Distributions

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

pointtree-1.0.1-cp314-cp314-win_amd64.whl (935.8 kB view details)

Uploaded CPython 3.14Windows x86-64

pointtree-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (765.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pointtree-1.0.1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (702.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

pointtree-1.0.1-cp314-cp314-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pointtree-1.0.1-cp313-cp313-win_amd64.whl (911.1 kB view details)

Uploaded CPython 3.13Windows x86-64

pointtree-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (765.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pointtree-1.0.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (701.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

pointtree-1.0.1-cp313-cp313-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pointtree-1.0.1-cp312-cp312-win_amd64.whl (911.1 kB view details)

Uploaded CPython 3.12Windows x86-64

pointtree-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (765.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pointtree-1.0.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (701.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

pointtree-1.0.1-cp312-cp312-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pointtree-1.0.1-cp311-cp311-win_amd64.whl (908.3 kB view details)

Uploaded CPython 3.11Windows x86-64

pointtree-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (768.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pointtree-1.0.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (702.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

pointtree-1.0.1-cp311-cp311-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file pointtree-1.0.1.tar.gz.

File metadata

  • Download URL: pointtree-1.0.1.tar.gz
  • Upload date:
  • Size: 133.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pointtree-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a53006035add711956a210d674a73bc293f54c8a8d40ab59179cbd2580152da1
MD5 adeae24a96a050377596a31c4ce34596
BLAKE2b-256 8db3b983e292e4d2b7adeaa003083d4480cfa39525a274843b9316b48d36e537

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pointtree-1.0.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 935.8 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pointtree-1.0.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b9d983ff85a63c30d3dc07492c4bf73947f3e1943feac47aa430afe7daa5fc54
MD5 f579b4ba1dec3bd53b16fbc8c3e27a58
BLAKE2b-256 9024906f2de4edb5611ce7907840e953d3c6cb8118b7f9968e7c02bb8be8e8b4

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a8bf2c680c747e93a0a726da7bbedbda7179161441955dfedb58dcb66f7b7e81
MD5 c01550a35b801e3d65cefe82646a6f5b
BLAKE2b-256 ddce41d0a7d63243249ff1f1f10ec6234dd5dd281fb103500acbd7b778047e3e

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 793ea0393e304304846f75c49b187d3c0d5771c281913cbb54409953d258114f
MD5 4a8f115f919b9802cf6ee5916d3d8778
BLAKE2b-256 e1e92e8d5bfad053cf6d7226d1db65ee5145a47f245d0b2d9cc7009b6f266abd

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b17887f588fcf9eac75660a5ef3215d50a5bd37337f7e87c908e66ac4eaf21a6
MD5 c9f493d3e54d40e11a879b157921a3e9
BLAKE2b-256 c69b8f77ce00a4d3f9db55f294b2959415f93295e2b7448fd8ed90571046af1e

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pointtree-1.0.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 911.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pointtree-1.0.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a4f87d0a475a13e1143189d44ca2842221979c107f48c23a9365cdabdf942c16
MD5 68ccf9a2f9c0184867f76ea65caa44a3
BLAKE2b-256 e7334c1b880c2b918cf3dc5f065bdc5ba70aa1504340deb6029f75a8b954e425

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f1bfd9c695c29de7f1eb757de7b4191a11b7ea62397729f8f0d4e98c55be6045
MD5 209616a88b26e1450dac86f02bb6720e
BLAKE2b-256 8a1e6c04a25682ba8c20788010285b79b2780f9d9cc34a85421396215f8458e0

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 49409690ec2fc3c6a39addfea3ce1e12cb54ba76ad17c52db66b8e965164a9de
MD5 10f0e44e89114a2c1ce5d8ee16c9b735
BLAKE2b-256 a134ee2e3a78acd82f501070986b4bead3b471226e23444bfefd397ad6a5d0fa

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fefec9b20d94082e3d24d76e151c9a7c6130b04ab4bf724abf5d71c841d00dbf
MD5 9c60cb8b5e88077dd0244ea8037914c6
BLAKE2b-256 bcc4f49218e3eed9d69320958c9bb66fea41940e85c4287853e4a0b34c9da12a

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pointtree-1.0.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 911.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pointtree-1.0.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1d23cb10c473c6033e508f32953347d87457a9efc5a63f5e1ad5c11844cb465f
MD5 6abb0208bc212cfec0db94aa158a525c
BLAKE2b-256 3bb9eebc4c0298461fc0432ddea76e17e91aa2f95e87565569813f6d732efb05

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 312a4c39ea3acbd5fcc13c0f05e3fda03ef494e881701c5632fbd130bf297203
MD5 ef3c73be7ecd81245679e78d0e3f159a
BLAKE2b-256 235e8223b522cc2154210d45341c0f99c082f22aa046ca3d2559cf67eac84c7b

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 50b2109155bf185afb92c54de9f4ee27996e9495bb7249ba9f7756dfd5b9cafa
MD5 c1ea0975df71af3dde878bfe7d7bdd50
BLAKE2b-256 32af16f3888bf4a875e35aa861b30cf7220687fd5349ddc98f2a0dad1a1e9d30

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4f0a10f1e278e904711b79553bb954a8bfba1d70b7ea858a289698001322b4be
MD5 e3f1f95576f19fb355e36fd6b1c56548
BLAKE2b-256 c4e414bf0a85a16adceca1e86a0d65e2f04352318446407bf9de4b9771b7dfa3

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pointtree-1.0.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 908.3 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pointtree-1.0.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 465a9ed7da010f575a6095f0a263776ba6caacbc429dcb012e7f6e3ab2f877b5
MD5 dc7c358ccaa25ca0d967863493dfc3b4
BLAKE2b-256 036efb927173d9d693b0c9e98aae15d1b0542368a63fee30dce94acf26819632

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 912c840c0f1de91a95b379f9d58b79d541986afbf3e044db0abf40a52b5085a1
MD5 bc2abd9081c4e7b8fee211eab6bacd41
BLAKE2b-256 40e4dd86a0e3aebfbe62f1ae586b146355d43870fbb92343151ef04beb88d062

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 aae52d3ad05851c8b55fa12ede4e79df502d38e9abf569bc1518242b895c6777
MD5 a9b3e82078a6bc121b87b41ed18d51ca
BLAKE2b-256 2d7f7521d5a573e458b051ebf340de224d00e72736bb6a13026efe349a4568e1

See more details on using hashes here.

File details

Details for the file pointtree-1.0.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pointtree-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4684f56cee6e806d4b0abe8a45469f2a9bea021804ce56e2b913c561a95a483d
MD5 38b30990897eaf0764a163380cb2d33f
BLAKE2b-256 54a385165a8bdbbf240fed6b20176de23e43dc774645e2f4522f71c41cd912ae

See more details on using hashes here.

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