Home

Awesome

System setup

xView2 inference requires a tremendous amount of computing power. Currently, CPU inference is wildly impractical. To that end, unless you have a dedicated workstation with ample GPU power such as an Nvidia DGX station, we recommend a cloud based solution such as AWS or Google Cloud Compute utilizing a GPU optimized instance. Prices vary on instance type and area to be inferred. Example instances:

  1. AWS EC2
    1. P4d.24xlarge
    2. P3.16xlarge
  2. G Cloud
    1. Todo!

Installation

Install from source

Note: Only tested on Linux systems.

  1. Close repository: git clone https://github.com/fdny-imt/xView2_FDNY.git.
  2. Create Conda environment: conda create --name xv2 --file spec-file.txt.
  3. Activate conda environment: conda activate xv2.

Docker

Todo.

Usage

ArgumentRequiredDefaultHelp
--pre_directoryYesNoneDirectory containing pre-disaster imagery. This is searched recursively.
--post_directoryYesNoneDirectory containing post-disaster imagery. This is searched recursively.
--output_directoryYesNoneDirectory to store output files. This will be created if it does not exist. Existing files may be overwritten.
--n_procsYes8Number of processors for multiprocessing
--batch_sizeYes2Number of chips to run inference on at once
--num_workersYes4Number of workers loading data into RAM. Recommend 4 * num_gpu
--pre_crsNoNoneThe Coordinate Reference System (CRS) for the pre-disaster imagery. This will only be utilized if images lack CRS data.
--post_crsNoNoneThe Coordinate Reference System (CRS) for the post-disaster imagery. This will only be utilized if images lack CRS data.
--destination_crsNoEPSG:4326The Coordinate Reference System (CRS) for the output overlays.
--output_resolutionNoNoneOverride minimum resolution calculator. This should be a lower resolution (higher number) than source imagery for decreased inference time. Must be in units of destinationCRS.
--dp_modeNoFalseRun models serially, but using DataParallel
--save_intermediatesNoFalseStore intermediate runfiles
--aoi_fileNoNoneShapefile or GeoJSON file of AOI polygons

Example invocation for damage assessment

On 2 GPUs: CUDA_VISIBLE_DEVICES=0,1 python handler.py --pre_directory <pre dir> --post_directory <post dir> --output_directory <output dir> --aoi_file <aoi file (GeoJSON or shapefile)> --n_procs <n_proc> --batch_size 2 --num_workers 6

Notes:

Sources

xView2 1st place solution