Skip to main content

Polygon classification MLA and example scripts.

Project description

A collection of Machine Learning (ML) Tools for object detection and classification on DG imagery.

mltools is MIT licenced.

The purpose of this repository is to enable fast prototyping of object detection and classification solutions.

At the moment, there are four modules:

  • data_extractors: functions to get pixels from georeferenced imagery;

  • feature_extractors: functions to derive feature vectors;

  • crowdsourcing: interface with Tomnod to obtain training/test/target data and to write machine output to Tomnod DB;

  • json_tools: functions to manipulate json and geojson files.

A ML algorithm (MLA) is a class with train and classify/detect functions. At the moment, the repo contains the PolygonClassifier MLA which can classify a set of polygons overlayed on a DG image.

An MLA is typically employed in a script which: - retrieves training data from Tomnod - trains the MLA - tests the MLA and computes accuracy metrics - deploys the MLA for detection or classification - writes the MLA results back to the Tomnod database.

Example scripts can be found under /examples.

Installation

Start with a fresh Ubuntu EC2 instance:

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install git python-virtualenv libpq-dev python-dev libatlas-base-dev gfortran libfreetype6-dev libpng-dev

Install GDAL:

sudo apt-get install gdal-bin

sudo apt-get install libgdal-dev libgdal1h

Create a python virtual environment in your project directory:

cd my_project

virtualenv venv

. venv/bin/activate

Install mltools:

pip install mltools

DevOps

Clone the repo:

git clone git@github.com:kostasthebarbarian/mltools.git

cd mltools

virtualenv venv

. venv/bin/activate

Generate key:

ssh-keygen -t rsa

more .ssh/id_rsa.pub

Copy this key to github.com deploy keys for the mltools repo.

Install the requirements:

pip install -r requirements.txt

Comments

mltools is developed as part of an effort to standardize MLA design and implementation.

Here is a slide with some ideas:

https://docs.google.com/drawings/d/1tKSgFMp0lLd7Abne8CdOhb1PbdJfgCz5x9XkLwDeET0/edit?usp=sharing

The vision is to employ MLA as part of a Crowd+Machine system along the lines of this document:

https://docs.google.com/document/d/1hf82I_jDNGc0NdopXxW9RkbQjLOOGkV4lU5kdM5tqlA/edit?usp=sharing

Imagery in the format required by a MLA (e.g., pansharpened, multi-spectral or orthorectified) can be obtained with the gbdxtools package (https://github.com/kostasthebarbarian/gbdxtools). You need GBDX credentials to use gbdxtools.

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

mltools-0.0.9.tar.gz (8.9 kB view details)

Uploaded Source

File details

Details for the file mltools-0.0.9.tar.gz.

File metadata

  • Download URL: mltools-0.0.9.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mltools-0.0.9.tar.gz
Algorithm Hash digest
SHA256 a067a7671e7295e3bafee5265d95d3ff169d806b51cdccf4f6218691c5c08b84
MD5 9a0546dceb68fae8c75390cc650a0aa0
BLAKE2b-256 6e0875a4c355462e3ad940f2217c010b0c3b9f46d9d88b29dc4d5b03a163c9a9

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