Skip to content

TreeSeg is a tool designed for the segmentation of individual trees using deep learning models.

License

Notifications You must be signed in to change notification settings

soenke-sp/TreeSeg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This project is no longer maintained.

The TreeSeg toolbox is outdated and no longer actively supported. While the code remains available for reference, it may not be compatible with the latest versions of ArcGIS Pro or Python environments. Use at your own risk.

TreeSeg

A tool for the segmentation of individual trees. It utilizes ArcGIS Pro and Python and allows processing of UAV multispectral images with channels for RGB, near-infrared, and red edge. The tool provides selection among four tested models: Faster R-CNN, Mask R-CNN, TensorMask, and SAM.

For Faster R-CNN, Mask R-CNN, and TensorMask, the NDRE (Normalized Difference Red Edge Index) of the multispectral image is first calculated. Subsequently, instance segmentation is performed, and a shapefile containing the individual trees is generated. It should be noted that, due to the optimal hyperparameter configuration, the calculation using SAM may take more than a day.

Tree Segmentation Example

Installation

To run this project, follow these steps:

  1. Download the toolbox file here.
  2. Open TreeSegV1.0.atbx in ArcGIS Pro. See Connect to a toolbox for more information.
  3. Run the script tool and follow the instructions.

Usage

  1. Import the UAV multispectral image (B, G, R, NIR, RE) into ArcGIS Pro.
  2. Select the desired model.
  3. Run the script tool to perform the instance segmentation and generate the shapefile of individual trees.
    Upon first execution of the tool, automatic installation of the required dependencies will occur. This process may take 20 minutes or longer, depending on your internet connection and system performance.

Sample Dataset

To test or explore the tool with example data, you can download a sample UAV multispectral dataset here:
Download Sample Dataset

This dataset includes:

  • Multispectral UAV imagery (RGB, NIR, RE)
  • Reference shapefiles of individual trees for validation or comparison

Known Issues

⚠️ Python Imaging Library (PIL) Error

Some users have encountered the following error when running the tool:

AttributeError: module 'PIL' has no attribute 'Image'

This error typically occurs when PIL is imported incorrectly. To fix it:

  1. Ensure you import the module correctly:
    from PIL import Image

  2. Make sure that the Pillow library (a maintained fork of PIL) is installed and up to date:
    pip install --upgrade pillow

  3. If the issue persists, refer to this helpful StackOverflow thread:
    https://stackoverflow.com/questions/11911480/python-pil-has-no-attribute-image

Model Checkpoints

The tool automatically downloads the required model checkpoints. For reference, the checkpoints can be found at the following links:

Reference

For more detailed information, please refer to the related paper: Link to Paper.

License

This project is licensed under the License.

About

TreeSeg is a tool designed for the segmentation of individual trees using deep learning models.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages