Code Monkey home page Code Monkey logo

basiss's Introduction

BASISS

Broad Area Satellite Imagery Semantic Segmentation

==============================================================================

Code Overview

This package segments satellite imagery over large swaths of land (or sea). The included examples use SpaceNet labels to identify roads in high resolution satellite imagery. Access to a GPU is required for training, though inference will function (slowly) on a CPU. See our blog post for further details.

==============================================================================

  1. Installation

     A. Install nvidia-docker
     B. Build container
     	nvidia-docker build -t basiss path_to_basiss/docker
     C. Download scripts
     	download this github repo (or put it in the docker file...)
     D. Run container
     	nvidia-docker run -it -v /raid:/raid --name bassiss_train basiss		
    

==============================================================================

  1. Download SpaceNet data, see the instructions.

==============================================================================

  1. Create training masks. The script used here is a lightly modified version of the code described in our blog. Execute these scripts in a unique conda environment; conda install insctuctions are here. The commands below create the training images; replace "train" with "test" to create testing images.

    basiss_path=/raid/local/src/basiss cd $basiss_path/src conda env create -f apls_environment.yml # to deactivate environment: source deactivate source activate apls_environment

    #for details on arguments type: python create_spacenet_masks.py --help python $basiss_path/create_spacenet_masks.py
    --path_data=/path_to_spacenet_data/AOI_2_Vegas_Train
    --output_df_path=$basiss_path/packaged_data/AOI_2_Train_2m_file_locs.csv
    --buffer_meters=2
    --n_bands=3
    --make_plots=0
    --overwrite_ims=0

Alt text

==============================================================================

  1. Train a model

    # train Las Vegas SpaceNet 3-band data with unet, and sliced into 400 
    #  	pixel cutouts
    basiss_path=/raid/local/src/basiss
    outname=AOI_2_Vegas_unet_2m_train
    cd $basiss_path
    nohup python -u src/basiss.py \
    	--path $basiss_path \
    	--model unet \
    	--mode train \
    	--file_list AOI_2_Train_2m_file_locs.csv \
    	--slice_x 400 --slice_y 400 \
    	--stride_x 300 --stride_y 300 \
    	--n_bands 3 \
    	--n_classes 2 \
    	--batchsize 32 \
    	--validation_split 0.1 \
    	--early_stopping_patience 4 \
    	--epochs 128 \
    	--gpu 0 \
    	--prefix $outname > \
    		results/$outname.log & tail -f results/$outname.log
    

==============================================================================

  1. Test on images of arbitrary size

     # test Las Vegas SpaceNet 3-band data with unet, and sliced into 400 
     #  	pixel cutouts
     basiss_path=/raid/local/src/basiss
     outname=AOI_2_Vegas_unet_2m_test
     cd $basiss_path
     nohup python -u src/basiss.py \
     	--path $basiss_path \
     	--model unet \
     	--mode test \
     	--file_list massive_file_list.csv \
     	--model_weights AOI_2_Vegas_unet_2m_train_model_best.hdf5 \
     	--slice_x 400 --slice_y 400 \
     	--stride_x 300 --stride_y 300 \
     	--n_bands 3 \
     	--n_classes 2 \
     	--batchsize 16 \
     	--gpu 3 \
     	--prefix $outname > \
     		results/$outname.log & tail -f results/$outname.log
    

Alt text

basiss's People

Contributors

avanetten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

basiss's Issues

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.