Skip to content

Commit 75c480e

Browse files
committed
allow potsdam example to be run w/o downloading files [skip ci]
1 parent 775e295 commit 75c480e

File tree

1 file changed

+8
-2
lines changed
  • rastervision_pytorch_backend/rastervision/pytorch_backend/examples/semantic_segmentation

1 file changed

+8
-2
lines changed

rastervision_pytorch_backend/rastervision/pytorch_backend/examples/semantic_segmentation/isprs_potsdam.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def get_config(runner,
4444
external_model: bool = True,
4545
augment: bool = False,
4646
nochip: bool = True,
47+
allow_streaming: bool = False,
4748
num_epochs: int = 10,
4849
batch_sz: int = 8,
4950
test: bool = False) -> SemanticSegmentationConfig:
@@ -69,6 +70,8 @@ def get_config(runner,
6970
training instead of from pre-generated chips. The analyze and chip
7071
commands should not be run, if this is set to True. Defaults to
7172
True.
73+
allow_streaming (bool): If True, read directly from remote files
74+
instead of downloading them. Defaults to False.
7275
num_epochs (int): Number of epochs to train for.
7376
batch_sz (int): Batch size.
7477
test (bool): If True, does the following simplifications:
@@ -142,7 +145,9 @@ def make_scene(id) -> SceneConfig:
142145
label_uri = label_crop_uri
143146

144147
raster_source = RasterioSourceConfig(
145-
uris=[raster_uri], channel_order=channel_order)
148+
uris=[raster_uri],
149+
channel_order=channel_order,
150+
allow_streaming=allow_streaming)
146151

147152
# Using with_rgb_class_map because label TIFFs have classes encoded as
148153
# RGB colors.
@@ -151,7 +156,8 @@ def make_scene(id) -> SceneConfig:
151156
uris=[label_uri],
152157
transformers=[
153158
RGBClassTransformerConfig(class_config=class_config)
154-
]))
159+
],
160+
allow_streaming=allow_streaming))
155161

156162
# URI will be injected by scene config.
157163
# Using rgb=True because we want prediction TIFFs to be in

0 commit comments

Comments
 (0)