Code Monkey home page Code Monkey logo

automated-building-detection's Introduction

version: 0.0.0 style: PEP 8

automated-building-detection

Automated Building Detection using Deep Learning: a NLRC/510 tool

Scope: quickly map a large area to support disaster response operations

Input: very-high-resolution (<= 0.5 m/pixel) RGB satellite images. Currently supported:

  • Bing Maps
  • Any custom image in raster format

Output: buildings in vector format (geojson), to be used in digital map products

Credits

Built on top of robosat and robosat.pink.

Development: Ondrej Zacha, Wessel de Jong, Jacopo Margutti

Contact: Jacopo Margutti.

Structure

  • abd_utils utility functions to download/process satellite images
  • abd_model framework to train and run building detection models on images
  • input input/configuration files needed to run the rest

Requirements:

To download satellite images:

To run the building detection models:

If using Docker

Getting started

Using Docker

  1. Install Docker.
  2. Download the latest Docker Image
docker pull rodekruis/automated-building-detection
  1. Create a docker container and connect it to a local directory (<path-to-your-workspace>)
docker run --name automated-building-detection -dit -v <path-to-your-workspace>:/workdir --ipc=host --gpus all -p 5000:5000 rodekruis/automated-building-detection
  1. Access the container
docker exec -it automated-building-detection bash

Manual Setup

  1. Install Python 3.7 and pip
  2. Install Anaconda
  3. Create and activate a new Anaconda environment
conda create --name abdenv python=3.7 
conda activate abdenv
  1. From root directory, move to abd_utils and install
cd abd_utils
pip install .
  1. Move to abd_model and install
cd ../abd_model
pip install .

N.B. Remember to activate abdenv next time

End-to-end example

How to use these tools? We take as example a small Dutch town; to predict the buildings in another area, simply change the input AOI (you can create your own using e.g. geojson.io).

Detailed explanation on usage and parameters of the different commands is given in the subdirectories abd_utils and abd_model.

  1. Add you Bing Maps Key in abd_utils/src/abd_utils/.env (the Docker container has vim pre-installed)
  2. Download the images of the AOI, divided in tiles
download-images --aoi input/AOI.geojson --output bing-images
  1. Convert the images into the format needed to run the building detection model
images-to-abd --images bing-images/images --output abd-input
  1. Download a pre-trained model (more details below) and add it to the input directory
  2. Run the building detection model
abd predict --config input/config.toml --dataset abd-input --cover abd-input/cover.csv --checkpoint input/neat-fullxview-epoch75.pth --out abd-predictions --metatiles --keep_borders
  1. Vectorize model output (from pixels to polygons)
abd vectorize --config input/config.toml --type Building --masks abd-predictions --out abd-predictions/buildings.geojson
  1. Merge touching polygons, remove small artifacts, simplify geometry
filter-buildings --data abd-predictions/buildings.geojson --dest abd-predictions/buildings-clean.geojson

Model collection

automated-building-detection's People

Contributors

jmargutt avatar

Stargazers

 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.