Skip to content

Commit 9d00feb

Browse files
authored
Merge pull request #10 from azavea/lf/vegas
Add Vegas example for all three tasks
2 parents 26ca2c2 + 2da064e commit 9d00feb

File tree

4 files changed

+359
-246
lines changed

4 files changed

+359
-246
lines changed

README.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This repository holds examples for Raster Vision usage on open datasets.
55
Table of Contents:
66
- [Setup and Requirements](#setup-and-requirements)
77
- [SpaceNet Rio Building Chip Classification](#spacenet-rio-building-chip-classification)
8-
- [Spacenet Vegas Road and Building Semantic Segmentation](#spacenet-vegas-road-and-building-semantic-segmentation)
8+
- [Spacenet Vegas Roads and Buildings: All Tasks](#spacenet-vegas)
99
- [ISPRS Potsdam Semantic Segmentation](#isprs-potsdam-semantic-segmentation)
1010
- [COWC Potsdam Car Object Detection](#cowc-potsdam-car-object-detection)
1111
- [xView Vehicle Object Detection](#xview-vehicle-object-detection)
@@ -52,9 +52,9 @@ Using the `-n` or `--dry-run` flag is useful to see what you're about to run bef
5252
Combine this with the verbose flag for different levels of output:
5353

5454
```
55-
> rastervision run spacenet.chip_classification -a root_uri s3://example/ --dry_run
56-
> rastervision -v run spacenet.chip_classification -a root_uri s3://example/ --dry_run
57-
> rastervision -vv run spacenet.chip_classification -a root_uri s3://example/ --dry_run
55+
> rastervision run spacenet.rio_chip_classification -a root_uri s3://example/ --dry_run
56+
> rastervision -v run spacenet.rio_chip_classification -a root_uri s3://example/ --dry_run
57+
> rastervision -vv run spacenet.rio_chip_classification -a root_uri s3://example/ --dry_run
5858
```
5959

6060
Use `-x` to avoid checking if files exist, which can take a long time for large experiments.
@@ -112,7 +112,7 @@ Run through this notebook (instructions are included).
112112

113113
### Step 2: Run Raster Vision
114114

115-
The experiment we want to run is in `spacenet/chip_classification.py`.
115+
The experiment we want to run is in `spacenet/rio_chip_classification.py`.
116116

117117
To run this, get into the docker container by typing:
118118

@@ -125,7 +125,7 @@ You'll need to pass the experiment an S3 URI that you have write access to, that
125125
If you are running locally (which means you're running this against a GPU machine with a good connection), run:
126126

127127
```
128-
> rastervision run local -e spacenet.chip_classification -a root_uri ${RVROOT}
128+
> rastervision run local -e spacenet.rio_chip_classification -a root_uri ${RVROOT}
129129
```
130130

131131
If you are running on AWS Batch, run:
@@ -191,9 +191,9 @@ Viewing the validation scene results for scene ID `013022232023` looks like this
191191
![QGIS results explorer](img/qgis-spacenet-cc.png)
192192

193193

194-
## Spacenet Vegas Road and Building Semantic Segmentation
194+
## Spacenet Vegas Roads and Buildings: All Tasks <a name="spacenet-vegas"></a>
195195

196-
This example runs semantic segmentation on the [Spacenet Vegas](https://spacenetchallenge.github.io/AOI_Lists/AOI_2_Vegas.html) dataset with the option to choose either roads or buildings.
196+
This example shows how to run an experiment on the [Spacenet Vegas](https://spacenetchallenge.github.io/AOI_Lists/AOI_2_Vegas.html) dataset with the option to choose either roads or buildings, and use any task.
197197

198198
### (Optional) Step 1: Download data
199199

@@ -203,28 +203,34 @@ You can run this example both remotely and locally without having to manually do
203203

204204
To run a small experiment locally to test that things are setup properly, invoke
205205
```
206-
rastervision run local -e spacenet.semantic_segmentation \
206+
rastervision run local -e spacenet.vegas \
207207
-a test True \
208-
-a root_uri ${ROOT_URI} \
209-
-a target ${TARGET}
208+
-a root_uri <root_uri> \
209+
-a target <target> \
210+
-a task_type <task_type>
210211
```
211-
where `${ROOT_URI}` is your local RV root, for instance `/opt/data/spacenet-vegas`, and
212-
`${TARGET}` is either `roads` or `buildings`. If you would like to use data stored locally during Step 1, add the `-a use_remote_data False` flag.
212+
where:
213+
* `<root_uri>` is your local RV root, for instance `/opt/data/spacenet-vegas`
214+
* `<target>` can be either `roads` or `buildings`.
215+
* `<task_type>` can be `semantic_segmentation`, `object_detection`, or `chip_classification`. However, only `semantic_segmentation` currently works with `roads`.
216+
217+
If you would like to use data stored locally during Step 1, add the `-a use_remote_data False` flag.
213218

214219
To run a full experiment remotely, invoke
215220
```
216-
rastervision run aws_batch -e spacenet.semantic_segmentation \
217-
-a test False \
218-
-a root_uri ${ROOT_URI} \
219-
-a target ${TARGET}
221+
rastervision run aws_batch -e spacenet.vegas \
222+
-a test True \
223+
-a root_uri <root_uri> \
224+
-a target <target> \
225+
-a task_type <task_type>
220226
```
221-
with a remote `${ROOT_URI}`.
227+
with a remote `<root_uri>`.
222228

223-
The experiment config is set to train a Mobilenet for 100k steps which takes about 6hrs on a P3 instance. If you modify the config to use Inception for 150k steps (see comment in code), it takes about 24 hours to train on a P3.
229+
Running semantic segmentation on roads trains a Mobilenet for 100k steps which takes about 6hrs on a P3 instance.
224230

225231
### Step 3: View results
226232

227-
After training the Inception model on the Roads dataset, using the QGIS plugin, you should see predictions and an eval like the following.
233+
After training a semantic segmentation model on roads, using the QGIS plugin, you should see predictions and an eval similar to the following.
228234

229235
![Spacenet Vegas Roads in QGIS](img/spacenet-vegas-roads-qgis.png)
230236

spacenet/semantic_segmentation.py

Lines changed: 0 additions & 226 deletions
This file was deleted.

0 commit comments

Comments
 (0)