Git Product home page Git Product logo

deadtrees's Introduction

DeadTrees

Algorithm for detection of dead trees in multispectral images.

The work flow is developed in the following steps.

First step: initialization

The first step is the initialization (initialize.py). It calls the clipshape functions. It clips the raster with the shape of the training set. The clipshape creates a dictionary, in which the keys are the categories provided by the training set (shapefile, see detailed description of the input below), and the values are numpy arrays with the clips of the raster. Once this object is created, it is saved into a pickle object in pickle/clip/. It overwrites, so make sure to chose a different name for the clip if you want a new one.

Second step: training

The training is performed by train.py. It takes in input the pickle clip (created by initialize.py) and the name you want to use for the model. It creates the model in the directory pickle/model/. If the folder doesn't exist, it creates it. It overwrites, so make sure to chose a different name for the model if you want a new file.

Third step: classification

The classification is performed by predict.py. It takes in input the path where the orthophotos are and loops over them. It also takes as input the folder where you want to save the results, and the pickle model created by train.py. The classification is performed with KNN algorithm.


Paths explanation

RasterPath

Path to training ortophoto.

Path to shapefile (training set)

The shapefile is a training set, defined by polygons containing different classes. The classes or categories are indicated in the field "zona" of the attribute table.

Example:

Category Description
1 Dead trees
2 Healthy trees
3 Soil
4 Shadowed zone

It is important to make sure that all the classes are well represented in the training set. The training set is created manually.

Path to orthophotos

Path to orthophotos to be classified.

Path to pickle model

(Automatically created) where the result of the training is written as a pickle object.

Path to pickle clip

(Automatically created) Where the clip created by the initialization will be written.


Dependencies

  • Libspatialindex (confusionmatrix.py)
  • GDAL
  • Numpy
  • Matplotlib
  • Sklearn
  • Scikit-Image (eq.py)

deadtrees's People

Contributors

madi avatar martinezlaura avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.