hotosm / ml-enabler

A service that integrates ML models to mapping applications.
https://www.hotosm.org/updates/the-machine-learning-enabler/
BSD 2-Clause "Simplified" License
40 stars 11 forks source link

ml-enabler

A service that integrates ML models to applications like Tasking Manager.

ML Enabler is now maintained and developed by Development Seed.


Background

Machine Learning has proven to be very successful to make mapping fast with high quality. With a diverse set of models and tools, it is hard to integrate them to existing tools like Tasking Manager and iD. HOT is developing ml-enabler to enable AI-assist to existing mapping tools.

ml-enabler is two projects:

  1. ml-enabler-api (this repo) - Storage and API to hold tile level ML prediction data.
  2. ml-enabler-cli (repo) - CLI for interacting with models and subscribe them to the ml-enabler-api

The API uses the following terms:

Using this API

See API.md

Development Setup

Using Docker

  1. Copy example.env to ml_enabler.env
  2. Run docker-compose build
  3. Run docker-compose up

Manual

  1. Create a virtualenv - python3 -m venv venv
  2. Enable the virtualenv ./venv/bin/activate
  3. Install dependencies pip install -r requirements.txt
  4. Setup the database:
    • Setup database. If you're on a Mac use Postgres.app, or use docker
    • Copy example.env to ml_enabler.env and add database configuration
    • Initialize tables flask db upgrade
  5. Start the app
    • export FLASK_APP="ml_enabler"
    • export FLASK_ENV="development"
    • flask run

Tests

  1. Create a database for your tests:
    • createdb ml_enabler_test
    • Enabler postgis echo 'CREATE EXTENSION postgis' | psql -d ml_enabler_test
  2. Run tests with python3 -m unittest discover ml_enabler/tests/