• Stars
    star
    512
  • Rank 86,323 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated 15 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python Package for Airborne RGB machine learning

DeepForest

Github Actions Documentation Status Version DOI

Conda-forge build status

Name Downloads Version Platforms
Conda Recipe Conda Downloads Conda Version Conda Platforms

A pytorch implementation of the DeepForest model for individual tree crown detection in RGB images. DeepForest is a python package for training and predicting individual tree crowns from airborne RGB imagery. DeepForest comes with a prebuilt model trained on data from the National Ecological Observatory Network. Users can extend this model by annotating and training custom models starting from the prebuilt model.

DeepForest es un paquete de python para la predicción de coronas de árboles individuales basada en modelos entrenados con imágenes remotas RVA ( RGB, por sus siglas en inglés). DeepForest viene con un modelo entrenado con datos proveídos por la Red Nacional de Observatorios Ecológicos (NEON, por sus siglas en inglés). Los usuarios pueden ampliar este modelo pre-construido por anotación de etiquetas y entrenamiento con datos locales. La documentación de DeepForest está escrita en inglés, sin embargo, agradeceríamos contribuciones con fin de hacerla accesible en otros idiomas.

DeepForest(PyTorch版本)是一个Python软件包,它可以被用来训练以及预测机载RGB图像中的单个树冠。DeepForest内部带有一个基于国家生态观测站网络(NEON : National Ecological Observatory Network)数据训练的预训练模型。在此模型基础上,用户可以注释新的数据然后训练自己的模型。DeepForest的文档是用英文编写的,如果您有兴趣为翻译文档做出贡献。欢迎与我们团队联系。

Motivation

The goal of deepforest is to provide an easy to access deep learning model for tree crown prediction in RGB images. The baseline model was primarily designed for forest images in 3cm imagery. Applications to urban images and lower resolution data can be successful, but need additional effort. For basic use see

https://deepforest.readthedocs.io/en/latest/getting_started.html#

Try Demo using Jupyter Notebook

Incorportating local data will always help prediction accuracy to customize the release model see see Google colab demo on model training

Installation

Deepforest can be install using either pip or conda.

pip

pip install deepforest

conda CPU

Conda-based installs can be slow. We recommend using mamba to speed them up.

conda create -n deepforest python=3 pytorch torchvision -c pytorch
conda activate deepforest
conda install deepforest albumentations -c conda-forge

conda GPU

Depending on the GPU you will need with cudatoolkit=10.2 or cudatoolkit=11.3:

conda create -n deepforest python=3 pytorch torchvision cudatoolkit=10.2 -c pytorch
conda activate deepforest
conda install deepforest albumentations -c conda-forge

Usage

Use Benchmark release

from deepforest import main
m = main.deepforest()
m.use_release()

Train a new model

m.create_trainer()
m.trainer.fit(m)
m.evaluate(csv_file=m.config["validation"]["csv_file"], root_dir=m.config["validation"]["root_dir"])

Predict a single image

#Create a sample 3 band image
image = np.random.random((400,400,3)).astype("float32")
prediction = m.predict_image(image = image)

Predict a large tile

Split the large tile into small pieces, predict each piece and re-assemble

predicted_boxes = m.predict_tile(raster_path = raster_path,
                                        patch_size = 300,
                                        patch_overlap = 0.5,
                                        return_plot = False)

Evaluate a file of annotations using intersection-over-union as an metric of accuracy

csv_file = get_data("example.csv")
root_dir = os.path.dirname(csv_file)
results = m.evaluate(csv_file, root_dir, iou_threshold = 0.5)

Config

DeepForest comes with a default config file (deepforest_config.yml) to control the location of training and evaluation data, the number of gpus, batch size and other hyperparameters. This file can be edited directly, or using the config dictionary after loading a deepforest object.

from deepforest import main
m = main.deepforest()
m.config["batch_size"] = 10

Config parameters are documented here.

Tree Detection Benchmark score

Tree detection is a central task in forest ecology and remote sensing. The Weecology Lab at the University of Florida has built a tree detection benchmark for evaluation. After building a model, you can compare it to the benchmark using the evaluate method.

git clone https://github.com/weecology/NeonTreeEvaluation.git
cd NeonTreeEvaluation
results = m.evaluate(csv_file = "evaluation/RGB/benchmark_annotations.csv", root_dir = "evaluation/RGB/")
results["box_recall"]
results["box_precision"]

Using DeepForest in R

R wrapper is available for DeepForest in the deepforestr package.

More Repositories

1

retriever

Quickly download, clean up, and install public datasets into a database management system
Python
307
star
2

NeonTreeEvaluation

Benchmark dataset for tree detection for airborne RGB, Hyperspectral and LIDAR imagery
Python
131
star
3

ogrants

Open grants list
R
129
star
4

DeepTreeAttention

Implementation of Hang et al. 2020 "Hyperspectral Image Classification with Attention Aided CNNs" for tree species prediction
Python
118
star
5

DeepLidar

LIDAR and RGB Deep Learning Model for Individual Tree Segmentation
Python
58
star
6

data-sharing-paper

Paper on data sharing in ecology for IEE special issue
Shell
46
star
7

PortalData

Official Repo of the Portal Project Data
R
46
star
8

LDATS

Latent Dirichlet Allocation coupled with Bayesian Time Series analyses
R
25
star
9

NeonTreeEvaluation_package

R package for evaluating individual tree crown predictions against a diverse benchmark dataset
R
22
star
10

forecasting-course

Morgan Ernest & Ethan White's Ecological Forecasting & Dynamics Course
HTML
20
star
11

DeepForest-pytorch

Pytorch implementation of the deepforest model for tree crown RGB detection.
JavaScript
17
star
12

livedat

Template for living data workflow
R
15
star
13

portal-teachingdb

A simplified version of the Portal Project database designed for teaching
Python
14
star
14

MATSS

R Package for Macroecological Analysis of Time Series Structure (MATSS)
R
14
star
15

white-etal-2012-ecology

Code for replicating "Characterizing species-abundance distributions across taxa and ecosystems using a simple maximum entropy model" by Ethan P. White, Katherine M. Thibault, and Xiao Xiao
Python
13
star
16

portalr

A collection of functions to summarize the Portal Data
R
11
star
17

BirdDetector

A global bird detector model for the DeepForest-pytorch package
Jupyter Notebook
10
star
18

METE

Software for fitting and testing John Harte and colleagues' Maximum Entropy Theory of Ecology.
Python
10
star
19

deepforestr

TeX
10
star
20

macroecotools

Tools for Macroecological Analyses Using Python
Python
9
star
21

pydataweaver

The Pydata Weaver: A data Integration platform
Python
9
star
22

portalPredictions

Using various models to forecast abundances at Portal
9
star
23

portalcasting

Model development, deployment, and evaluation for forecasting Portal ecosystem dynamics
R
8
star
24

TreeSegmentation

Reproducible analysis of tree segmentation methods in R.
HTML
8
star
25

sad-comparison

Elita Baldridge's dissertation repository
Python
8
star
26

forecasting-dynamics-course

Morgan Ernest and Ethan White's course on Ecological Dynamics and Forecasting
HTML
8
star
27

MillionTrees

The MillionTreesBenchmark
Python
8
star
28

abundance

zero-inflated negative binomial neural network with variational approximation to site-level & observer-level random effects
Jupyter Notebook
7
star
29

bibliometrics

Bibliometric research
Python
7
star
30

bbs-forecasting

Research on forecasting using Breeding Bird Survey data
Jupyter Notebook
7
star
31

retrieverdash

Dashboard for retriever dataset status
Python
6
star
32

MATSS-forecasting

Forecasting Analysis Comparison for Ecological Time Series
R
5
star
33

Retriever.jl

Julia wrapper for the Data Retriever software
Julia
5
star
34

mete-spatial

Research on the spatial predictions of METE
R
5
star
35

retriever-recipes

Python
5
star
36

website

Lab website
TeX
4
star
37

livedat-github-actions

R
4
star
38

experimental-rads

R
3
star
39

MATSS-LDATS

Macroecological LDA analysis of time series
R
3
star
40

NeonTreeEvaluation_python

python benchmark for individual tree crown methods
Python
3
star
41

DeepForest_demos

DEPRECATED DeepForest demos
Jupyter Notebook
3
star
42

ratdat

R package version of Portal Project Teaching Database
R
3
star
43

branch-arch

HTML
3
star
44

neonwranglerpy

Python
3
star
45

EvergladesWadingBird

Data from the Everglades breeding bird monitoring project
R
3
star
46

ecology-data-cache

2
star
47

lab-manual

Shell
2
star
48

mvgamportal

R
2
star
49

DeepForest_Model

Companion repo to DeepForest for training large models from DeepForest python package.
Python
2
star
50

MATSSdemo

Automated build of a MATSS compendium
HTML
2
star
51

forecast_evaluation

Methods and tools for evaluating probabilistic forecasts
R
2
star
52

feasiblesets

Research code for understanding distributions of wealth in the context of all possible distributions
C
2
star
53

DoubleCounting

A repo for visualizing airborne imagery, making a prediction with a deepforest model and remove double counting among overlapping images.
Python
2
star
54

mete-geog

Research on making geographic predictions for macroecological patterns using the Maximum Entropy Theory of Ecology
R
2
star
55

mcdb

Mammal community database updates
1
star
56

diversity-conservation

Python
1
star
57

datawiki

Efforts related to http://ecologicaldata.org
PHP
1
star
58

portal-tools

Code for working with the Portal Project data
Python
1
star
59

NEON_crown_maps

Generating tree crown maps for NEON sites
HTML
1
star
60

retriever-website

Website for the EcoData Retriever
CSS
1
star
61

retriever-site

http://www.data-retriever.org
CSS
1
star
62

portal-exploration

Exploration of the Portal data, using portalr
R
1
star
63

EvergladesSpeciesModel

A deepforest model for wading bird species prediction.
Python
1
star
64

DeepTreeScape

Joint RGB and Deep Learning for individual tree detection
Makefile
1
star
65

mete-energy

Research on the energetic predictions of METE
Python
1
star
66

ESA_workshop_2022

lessons taught at the ESA workshop 2022 titled
HTML
1
star
67

NeonTreeEvaluation_analysis

This is the companion repo that presents analysis for methods tested on the NeonTreeEvaluation benchmark repo
Python
1
star
68

NeonSpeciesBenchmark

A tree species classification benchmark for the National Ecological Observatory Network
Python
1
star
69

NDVIning

sifting and comparing multiple NDVI sources and ensembles
R
1
star
70

forecasts

Archived forecasts for future analysis
1
star
71

portal-explorer

Shiny App for exploratory data analysis of the Portal Project
R
1
star
72

portal-experimental-macroeco

Code for reproducing the results from "An experimental test of the response of macroecological patterns to altered species interactions" by Sarah Supp et al. 2013 publishe in Ecology
1
star
73

bbc-data-rescue

Extracting data from Breeding Bird Census publications
Python
1
star
74

portal-rodent-dispersal

Research on rodent dispersal patterns near Portal AZ
R
1
star
75

MATSS-startup

Macroecological Analysis of Time Series Structure
R
1
star
76

TreeDemo

Shiny app for tree detection in RGB imagery
Python
1
star
77

wader

A collection of functions to retrieve and summarize the EvergladesWadingBird Data
R
1
star
78

AirborneBirds

The Airborne Birds benchmark
1
star
79

wiki

Weecology's Wiki - how to navigate life in the lab from choosing and pursuing a career path to using the printer
HTML
1
star