detectree2

Python package for automatic tree crown delineation based on the Detectron2 implementation of Mask R-CNN

https://github.com/PatBall1/detectree2

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 12 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    3 of 15 committers (20.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary

Keywords

deep-learning detectron2 python pytorch
Last synced: 6 months ago · JSON representation

Repository

Python package for automatic tree crown delineation based on the Detectron2 implementation of Mask R-CNN

Basic Info
Statistics
  • Stars: 205
  • Watchers: 5
  • Forks: 52
  • Open Issues: 46
  • Releases: 11
Topics
deep-learning detectron2 python pytorch
Created almost 4 years ago · Last pushed 6 months ago
Metadata Files
Readme License Code of conduct

README.md

predictions predictions

License: MIT Detectree CI PEP8 DOI

Python package for automatic tree crown delineation in aerial RGB and multispectral imagery based on Mask R-CNN. Pre-trained models can be picked in the model_garden. A tutorial on how to prepare data, train models and make predictions is available here. For questions, collaboration proposals and requests for data email James Ball. Some example data is available to download here.

Detectree2是一个基于Mask R-CNN的自动树冠检测与分割的Python包。您可以在model_garden中选择预训练模型。这里提供了如何准备数据、训练模型和进行预测的教程。如果有任何问题,合作提案或者需要样例数据,可以邮件联系James Ball。一些示例数据可以在这里下载。

| | Code developed by James Ball, Seb Hickman, Thomas Koay, Oscar Jiang, Luran Wang, Panagiotis Ioannou, James Hinton and Matthew Archer in the Forest Ecology and Conservation Group at the University of Cambridge. The Forest Ecology and Conservation Group is led by Professor David Coomes and is part of the University of Cambridge Conservation Research Institute. | | :---: | :--- |

Citation

Please cite this article if you use detectree2 in your work:

Ball, J.G.C., Hickman, S.H.M., Jackson, T.D., Koay, X.J., Hirst, J., Jay, W., Archer, M., Aubry-Kientz, M., Vincent, G. and Coomes, D.A. (2023), Accurate delineation of individual tree crowns in tropical forests from aerial RGB imagery using Mask R-CNN. Remote Sens Ecol Conserv. 9(5):641-655. https://doi.org/10.1002/rse2.332

Independent validation

Independent validation has been performed on a temperate deciduous forest in Japan.

Detectree2 (F1 score: 0.57) outperformed DeepForest (F1 score: 0.52)

Detectree2 could estimate tree crown areas accurately, highlighting its potential and robustness for tree detection and delineation

Gan, Y., Wang, Q., and Iio, A. (2023). Tree Crown Detection and Delineation in a Temperate Deciduous Forest from UAV RGB Imagery Using Deep Learning Approaches: Effects of Spatial Resolution and Species Characteristics. Remote Sensing. 15(3):778. https://doi.org/10.3390/rs15030778

Requirements

e.g. pip3 install torch torchvision torchaudio

Installation

pip

pip install git+https://github.com/PatBall1/detectree2.git

Currently works on Google Colab (Pro version recommended). May struggle on clusters if geospatial libraries are not configured. See Installation Instructions if you are having trouble.

conda

Under development

Getting started

Detectree2, based on the Detectron2 Mask R-CNN architecture, locates trees in aerial images. It has been designed to delineate trees in challenging dense tropical forests for a range of ecological applications.

This tutorial takes you through the key steps. Example Colab notebooks are also available but are not updated frequently so functions and parameters may need to be adjusted to get things working properly.

The standard workflow includes:

1) Tile the orthomosaics and crown data (for training, validation and testing) 2) Train (and tune) a model on the training tiles 3) Evaluate the model performance by predicting on the test tiles and comparing to manual crowns for the tiles 4) Using the trained model to predict the crowns over the entire region of interest

Training crowns are used to teach the network to delineate tree crowns.

predictions predictions

Here is an example image of the predictions made by Detectree2.

predictions

Applications

Tracking tropical tree growth and mortality

predicting

Counting urban trees (Buffalo, NY)

predicting

Multi-temporal tree crown segmentation

predicting

Liana detection and infestation mapping

In development

predicting

Tree species identification and mapping

In development

To do

  • Functions for multiple labels vs single "tree" label

Project Organization

├── LICENSE ├── Makefile ├── README.md ├── detectree2 │   ├── data_loading │   ├── models │   ├── preprocessing │   ├── R │   └── tests ├── docs │   └── source ├── model_garden ├── notebooks │   ├── colab │   ├── colabJB │   ├── colabJH │   ├── colabKoay │   ├── colabPan │   ├── colabSeb │   ├── exploratory │   ├── mask_rcnn │   │   ├── testing │   │   └── training │   ├── reports │   └── turing ├── report │   ├── figures │   └── sections └── requirements

Code formatting

To automatically format your code, make sure you have black installed (pip install black) and call black . from within the project directory.


Copyright (c) 2022, James G. C. Ball

Owner

  • Name: James Ball
  • Login: PatBall1
  • Kind: user
  • Location: Cambridge, UK
  • Company: Forest Ecology and Conservation Group, University of Cambridge

AI/ML for tropical forests @ForEcolZappers

GitHub Events

Total
  • Fork event: 12
  • Create event: 8
  • Commit comment event: 1
  • Release event: 1
  • Issues event: 36
  • Watch event: 40
  • Delete event: 4
  • Member event: 1
  • Issue comment event: 66
  • Push event: 67
  • Pull request review comment event: 3
  • Pull request review event: 9
  • Pull request event: 48
Last Year
  • Fork event: 12
  • Create event: 8
  • Commit comment event: 1
  • Release event: 1
  • Issues event: 36
  • Watch event: 40
  • Delete event: 4
  • Member event: 1
  • Issue comment event: 66
  • Push event: 67
  • Pull request review comment event: 3
  • Pull request review event: 9
  • Pull request event: 48

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 366
  • Total Committers: 15
  • Avg Commits per committer: 24.4
  • Development Distribution Score (DDS): 0.585
Past Year
  • Commits: 50
  • Committers: 5
  • Avg Commits per committer: 10.0
  • Development Distribution Score (DDS): 0.66
Top Committers
Name Email Commits
Ball JGC b****c@g****m 152
James Ball j****3@s****k 66
James Ball 3****1@u****m 49
James-Hirst-1998 h****j@g****m 24
Christopher Kotthoff c****7@r****m 17
James Ball j****3@c****k 17
Matthew Archer m****5@c****k 12
Christopher K 3****f@u****m 8
Matthew Archer 3****5@u****m 7
Charles Song c****g@g****m 4
Paul Tresson p****n@c****r 3
Andrés Camilo Zúñiga-González 3****o@u****m 2
Puming (Oscar) Jiang 1****g@u****m 2
Seb Hickman 5****0@u****m 2
ai4er-cookiecutter c****r@h****g 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 98
  • Total pull requests: 120
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 28
  • Total pull request authors: 11
  • Average comments per issue: 1.62
  • Average comments per pull request: 0.31
  • Merged pull requests: 83
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 26
  • Pull requests: 48
  • Average time to close issues: 20 days
  • Average time to close pull requests: 5 days
  • Issue authors: 11
  • Pull request authors: 4
  • Average comments per issue: 1.38
  • Average comments per pull request: 0.17
  • Merged pull requests: 35
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ma595 (29)
  • PatBall1 (20)
  • CiSong10 (7)
  • ChristopherKotthoff (4)
  • xabierr (4)
  • yby026 (3)
  • aloboa (3)
  • rjstack266 (3)
  • Coder-GAN (2)
  • DrawingWorkerChi (2)
  • ancazugo (2)
  • chenyuanyuan12138 (2)
  • Joda0515 (2)
  • ambarwariagus (1)
  • russelldj (1)
Pull Request Authors
  • PatBall1 (40)
  • ChristopherKotthoff (32)
  • ma595 (22)
  • 0scarJ1ang (7)
  • CiSong10 (5)
  • WangLuran (4)
  • James-Hirst-1998 (4)
  • Dseal95 (2)
  • ancazugo (2)
  • mpcabete (1)
  • ptresson (1)
Top Labels
Issue Labels
enhancement (11) bug (6) build (6) documentation (4) testing (1) performance (1) help wanted (1)
Pull Request Labels
build (4) documentation (3) enhancement (1)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 38 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 21
  • Total maintainers: 1
proxy.golang.org: github.com/patball1/detectree2
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
proxy.golang.org: github.com/PatBall1/detectree2
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
pypi.org: detectree2

Detectree packaging

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 38 Last month
Rankings
Dependent packages count: 6.6%
Forks count: 10.3%
Stargazers count: 15.3%
Average: 24.3%
Dependent repos count: 30.6%
Downloads: 58.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/docker-test.yml actions
  • GuillaumeFalourd/clone-github-repo-action v2 composite
  • actions/checkout v3 composite
.github/workflows/python-ci.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/sphinx-ci.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • peaceiris/actions-gh-pages v3 composite
docker/Dockerfile docker
  • nvidia/cuda 11.1.1-cudnn8-devel-ubuntu20.04 build
docs/requirements.txt pypi
  • jinja2 ==3.0.3
requirements/dev-requirements.txt pypi
  • black * development
  • flake8 * development
  • flake8-docstrings * development
  • isort * development
  • mypy * development
  • python-dotenv * development
requirements/requirements.txt pypi
  • Fiona ==1.8.21
  • Markdown ==3.3.6
  • Pillow ==9.0.1
  • PyCRS ==1.0.2
  • PyYAML ==5.1
  • Rtree ==0.9.7
  • Shapely ==1.8.1.post1
  • Werkzeug ==2.0.3
  • absl-py ==1.0.0
  • affine ==2.3.0
  • antlr4-python3-runtime ==4.8
  • appdirs ==1.4.4
  • attrs ==21.4.0
  • black ==21.4b2
  • cachetools ==5.0.0
  • certifi ==2021.10.8
  • charset-normalizer ==2.0.12
  • click ==8.0.4
  • click-plugins ==1.1.1
  • cligj ==0.7.2
  • cloudpickle ==2.0.0
  • cycler ==0.11.0
  • descartes ==1.1.0
  • detectron2 ==0.6
  • flake8 ==4.0.1
  • fonttools ==4.30.0
  • future ==0.18.2
  • fvcore ==0.1.5.post20220305
  • geopandas ==0.10.2
  • google-auth ==2.6.0
  • google-auth-oauthlib ==0.4.6
  • grpcio ==1.44.0
  • hydra-core ==1.1.1
  • idna ==3.3
  • importlib-metadata ==4.11.3
  • importlib-resources ==5.4.0
  • iopath ==0.1.9
  • kiwisolver ==1.4.0
  • matplotlib ==3.5.1
  • mccabe ==0.6.1
  • munch ==2.5.0
  • mypy-extensions ==0.4.3
  • numpy ==1.22.3
  • oauthlib ==3.2.0
  • omegaconf ==2.1.1
  • opencv-python ==4.5.5.64
  • packaging ==21.3
  • pandas ==1.4.1
  • pathspec ==0.9.0
  • portalocker ==2.4.0
  • protobuf ==3.19.4
  • pyasn1 ==0.4.8
  • pyasn1-modules ==0.2.8
  • pycocotools ==2.0.4
  • pycodestyle ==2.8.0
  • pydot ==1.4.2
  • pyflakes ==2.4.0
  • pygeos ==0.12.0
  • pyparsing ==3.0.7
  • pypng ==0.0.21
  • pyproj ==3.3.0
  • pytz ==2021.3
  • rasterio ==1.2.10
  • regex ==2022.3.15
  • requests ==2.27.1
  • requests-oauthlib ==1.3.1
  • rsa ==4.8
  • snuggs ==1.4.7
  • tabulate ==0.8.9
  • tensorboard ==2.8.0
  • tensorboard-data-server ==0.6.1
  • tensorboard-plugin-wit ==1.8.1
  • termcolor ==1.1.0
  • toml ==0.10.2
  • torch ==1.9.0
  • torchvision ==0.10.0
  • tqdm ==4.63.0
  • typing_extensions ==4.1.1
  • urllib3 ==1.26.9
  • yacs ==0.1.8
  • zipp ==3.7.0
requirements/test-requirements.txt pypi
  • click * test
  • coverage * test
  • flake8 * test
  • python-dotenv * test
  • sphinx * test
  • virtualenv * test
setup.py pypi
  • GDAL >=1.11
  • descartes *
  • detectron2 *
  • fiona *
  • geopandas *
  • geos *
  • proj *
  • pycrs *
  • pygeos *
  • pypng *
  • pyyaml ==5.1
  • rasterio ==1.3a3
requirements/environment.yml pypi
  • hydra-core *