|
1 | 1 | # System setup
|
2 |
| -xView2 inference requires a tremendous amount of computing power. Currently, CPU inference is wildly |
| 2 | + |
| 3 | +xView2 inference requires a tremendous amount of computing power. Currently, CPU inference is wildly |
3 | 4 | impractical. To that end, unless you have a dedicated workstation with ample GPU power such as an Nvidia DGX station,
|
4 | 5 | we recommend a cloud based solution such as AWS or Google Cloud Compute utilizing a GPU optimized instance. Prices vary
|
5 | 6 | on instance type and area to be inferred. Example instances:
|
| 7 | + |
6 | 8 | 1. AWS EC2
|
7 |
| - 1. P4d.24xlarge |
8 |
| - 2. P3.16xlarge |
| 9 | + 1. P4d.24xlarge |
| 10 | + 2. P3.16xlarge |
9 | 11 | 2. G Cloud
|
10 |
| - 1. Todo! |
| 12 | + 1. Todo! |
11 | 13 |
|
12 | 14 | # Installation
|
| 15 | + |
13 | 16 | ## Install from source
|
| 17 | + |
14 | 18 | **Note**: Only tested on Linux systems.
|
| 19 | + |
15 | 20 | 1. Close repository: `git clone https://github.com/fdny-imt/xView2_FDNY.git`.
|
16 | 21 | 2. Create Conda environment: `conda create --name xv2 --file spec-file.txt`.
|
17 | 22 | 3. Activate conda environment: `conda activate xv2`.
|
| 23 | + |
18 | 24 | ## Docker
|
| 25 | + |
19 | 26 | Todo.
|
20 | 27 |
|
21 | 28 | # Usage
|
22 |
| -|Argument|Required|Default|Help |
23 |
| -|---|---|---|---| |
24 |
| -|--pre_directory|Yes|None|Directory containing pre-disaster imagery. This is searched recursively.| |
25 |
| -|--post_directory|Yes|None|Directory containing post-disaster imagery. This is searched recursively.| |
26 |
| -|--output_directory|Yes|None|Directory to store output files. This will be created if it does not exist. Existing files may be overwritten.| |
27 |
| -|--n_procs|Yes|8|Number of processors for multiprocessing| |
28 |
| -|--batch_size|Yes|2|Number of chips to run inference on at once| |
29 |
| -|--num_workers|Yes|4|Number of workers loading data into RAM. Recommend 4 * num_gpu| |
30 |
| -|--pre_crs|No|None|The Coordinate Reference System (CRS) for the pre-disaster imagery. This will only be utilized if images lack CRS data.| |
31 |
| -|--post_crs|No|None|The Coordinate Reference System (CRS) for the post-disaster imagery. This will only be utilized if images lack CRS data.| |
32 |
| -|--destination_crs|No|EPSG:4326|The Coordinate Reference System (CRS) for the output overlays.| |
33 |
| -|--output_resolution|No|None|Override minimum resolution calculator. This should be a lower resolution (higher number) than source imagery for decreased inference time. Must be in units of destinationCRS.| |
34 |
| -|--dp_mode|No|False|Run models serially, but using DataParallel| |
35 |
| -|--save_intermediates|No|False|Store intermediate runfiles| |
36 |
| -|--aoi_file|No|None|Shapefile or GeoJSON file of AOI polygons |
| 29 | + |
| 30 | +| Argument | Required | Default | Help | |
| 31 | +| -------------------- | -------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 32 | +| --pre_directory | Yes | None | Directory containing pre-disaster imagery. This is searched recursively. | |
| 33 | +| --post_directory | Yes | None | Directory containing post-disaster imagery. This is searched recursively. | |
| 34 | +| --output_directory | Yes | None | Directory to store output files. This will be created if it does not exist. Existing files may be overwritten. | |
| 35 | +| --n_procs | Yes | 8 | Number of processors for multiprocessing | |
| 36 | +| --batch_size | Yes | 2 | Number of chips to run inference on at once | |
| 37 | +| --num_workers | Yes | 4 | Number of workers loading data into RAM. Recommend 4 \* num_gpu | |
| 38 | +| --pre_crs | No | None | The Coordinate Reference System (CRS) for the pre-disaster imagery. This will only be utilized if images lack CRS data. | |
| 39 | +| --post_crs | No | None | The Coordinate Reference System (CRS) for the post-disaster imagery. This will only be utilized if images lack CRS data. | |
| 40 | +| --destination_crs | No | EPSG:4326 | The Coordinate Reference System (CRS) for the output overlays. | |
| 41 | +| --output_resolution | No | None | Override minimum resolution calculator. This should be a lower resolution (higher number) than source imagery for decreased inference time. Must be in units of destinationCRS. | |
| 42 | +| --dp_mode | No | False | Run models serially, but using DataParallel | |
| 43 | +| --save_intermediates | No | False | Store intermediate runfiles | |
| 44 | +| --aoi_file | No | None | Shapefile or GeoJSON file of AOI polygons | |
37 | 45 |
|
38 | 46 | # Example invocation for damage assessment
|
| 47 | + |
39 | 48 | On 2 GPUs:
|
40 | 49 | `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`
|
41 | 50 |
|
42 | 51 | # Notes:
|
43 |
| - - CRS between input types (pre/post/building footprints/AOI) need not match. However CRS *within* input types must match. |
44 | 52 |
|
| 53 | +- CRS between input types (pre/post/building footprints/AOI) need not match. However CRS _within_ input types must match. |
45 | 54 |
|
46 | 55 | # Sources
|
| 56 | + |
47 | 57 | **xView2 1st place solution**
|
48 |
| - - Model weights from 1st place solution for "xView2: Assess Building Damage" challenge. https://www.xview2.org |
49 |
| - - More information from original submission see commit: 3fe4a7327f1a19b8c516e0b0930c38c29ac3662b |
| 58 | + |
| 59 | +- Model weights from 1st place solution for "xView2: Assess Building Damage" challenge. https://github.com/DIUx-xView/xView2_first_place |
| 60 | +- More information from original submission see commit: 3fe4a7327f1a19b8c516e0b0930c38c29ac3662b |
0 commit comments