this is a fake CLA for testing purposes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./output/ | |
| ├── bundle | |
| │ └── model-bundle.zip | |
| ├── eval | |
| │ └── eval.json | |
| ├── Makefile | |
| ├── pipeline-config.json | |
| ├── predict | |
| │ └── 6_12 | |
| │ └── labels.tif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| backend_config = PyTorchSemanticSegmentationConfig( | |
| data=data_config, | |
| model=SemanticSegmentationModelConfig( | |
| external_def=ExternalModuleConfig( | |
| github_repo='AdeelH/pytorch-fpn:0.2', | |
| name='fpn', | |
| entrypoint='make_fpn_resnet', | |
| entrypoint_kwargs={ | |
| 'name': 'resnet50', | |
| 'fpn_type': 'panoptic', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aug_transform = A.Compose([ | |
| A.Flip(), | |
| A.ShiftScaleRotate(), | |
| A.OneOf([ | |
| A.RGBShift(), | |
| A.ToGray(), | |
| A.ToSepia(), | |
| ]), | |
| A.OneOf([ | |
| A.RandomBrightness(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| train_scene = SceneConfig( | |
| id='2_10', | |
| raster_source=RasterioSourceConfig(uris=['./2_10_RGBIR.tif']), | |
| label_source=SemanticSegmentationLabelSourceConfig( | |
| rgb_class_config=class_config, | |
| raster_source=RasterioSourceConfig(uris=['./2_10_label.tif'])), | |
| aoi_uris=['./2_10_aoi.json']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data_config = SemanticSegmentationGeoDataConfig( | |
| scene_dataset=dataset_config, | |
| # read 200 randomly located chips of size 300x300 from the scene | |
| window_opts=GeoDataWindowConfig( | |
| method=GeoDataWindowMethod.random, | |
| size=300, | |
| size_lims=(200, 400), | |
| max_windows=200)) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| train_scene = SceneConfig( | |
| id='2_10', | |
| raster_source=RasterioSourceConfig( | |
| # include all 4 bands in the channel_order | |
| uris=['./2_10_RGBIR.tif'], channel_order=[0, 1, 2, 3]), | |
| label_source=SemanticSegmentationLabelSourceConfig( | |
| rgb_class_config=class_config, | |
| raster_source=RasterioSourceConfig(uris=['./2_10_label.tif']))) | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val_scene = SceneConfig( | |
| label_store=SemanticSegmentationLabelStoreConfig( | |
| rgb=True, | |
| vector_output=[ | |
| PolygonVectorOutputConfig(class_id=i) | |
| for i in range(len(class_config)) | |
| ]), | |
| smooth_output=True, | |
| smooth_as_uint8=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rastervision.pipeline.runner import * | |
| from rastervision.core.rv_pipeline import * | |
| from rastervision.core.data import * | |
| from rastervision.pytorch_backend import * | |
| from rastervision.pytorch_learner import * | |
| def get_config(runner: Runner, root_uri: str) -> SemanticSegmentationConfig: | |
| # specify class names and corresponding colors in the label rasters | |
| class_config = ClassConfig( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| from pystac import STAC_IO | |
| from pystac import Catalog, LabelItem | |
| from shapely.geometry import box | |
| def setup_stac_s3(): | |
| def my_read_method(uri): | |
| parsed = urlparse(uri) | |
| if parsed.scheme == 's3': | |
| bucket = parsed.netloc |
NewerOlder