This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
forked from sfoucher/dlm-extension
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update examples working against JSON schema (except check for cross-b…
…ands [AnyBandsRef])
- Loading branch information
1 parent
03e7e06
commit 2d6c70b
Showing
9 changed files
with
428 additions
and
78 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ | ||
"stac_version": "1.0.0", | ||
"stac_extensions": [ | ||
"https://stac-extensions.github.io/mlm/v1.0.0/schema.json" | ||
], | ||
"type": "Feature", | ||
"id": "example-model", | ||
"geometry": { | ||
"type": "Polygon", | ||
"coordinates": [ | ||
[ | ||
[ | ||
-7.882190080512502, | ||
37.13739173208318 | ||
], | ||
[ | ||
-7.882190080512502, | ||
58.21798141355221 | ||
], | ||
[ | ||
27.911651652899925, | ||
58.21798141355221 | ||
], | ||
[ | ||
27.911651652899925, | ||
37.13739173208318 | ||
], | ||
[ | ||
-7.882190080512502, | ||
37.13739173208318 | ||
] | ||
] | ||
] | ||
}, | ||
"bbox": [ | ||
-7.882190080512502, | ||
37.13739173208318, | ||
27.911651652899923, | ||
58.21798141355221 | ||
], | ||
"properties": { | ||
"datetime": null, | ||
"start_datetime": "1900-01-01T00:00:00Z", | ||
"end_datetime": "9999-12-31T23:59:59Z", | ||
"mlm:name": "example-model", | ||
"mlm:tasks": [ | ||
"classification" | ||
], | ||
"mlm:architecture": "ResNet", | ||
"mlm:input": [ | ||
{ | ||
"name": "Model with RGB input that does not refer to any band.", | ||
"bands": [], | ||
"input": { | ||
"shape": [ | ||
-1, | ||
3, | ||
64, | ||
64 | ||
], | ||
"dim_order": [ | ||
"batch", | ||
"channel", | ||
"height", | ||
"width" | ||
], | ||
"data_type": "float32" | ||
} | ||
} | ||
], | ||
"mlm:output": [ | ||
{ | ||
"name": "classification", | ||
"tasks": [ | ||
"classification" | ||
], | ||
"result": { | ||
"shape": [ | ||
-1, | ||
1 | ||
], | ||
"dim_order": [ | ||
"batch", | ||
"class" | ||
], | ||
"data_type": "uint8" | ||
}, | ||
"classification_classes": [ | ||
{ | ||
"value": 0, | ||
"name": "BACKGROUND", | ||
"description": "Background non-city.", | ||
"color_hint": [0, 0, 0] | ||
}, | ||
{ | ||
"value": 1, | ||
"name": "CITY", | ||
"description": "A city is detected.", | ||
"color_hint": [0, 0, 255] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"assets": { | ||
"model": { | ||
"href": "https://huggingface.co/example/model-card", | ||
"title": "Pytorch weights checkpoint", | ||
"description": "Example model.", | ||
"type": "text/html", | ||
"roles": [ | ||
"mlm:model" | ||
] | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,242 @@ | ||
{ | ||
"stac_version": "1.0.0", | ||
"stac_extensions": [ | ||
"https://stac-extensions.github.io/mlm/v1.0.0/schema.json", | ||
"https://stac-extensions.github.io/raster/v1.1.0/schema.json", | ||
"https://stac-extensions.github.io/file/v1.0.0/schema.json", | ||
"https://stac-extensions.github.io/ml-aoi/v0.2.0/schema.json" | ||
], | ||
"type": "Feature", | ||
"id": "resnet-18_sentinel-2_all_moco_classification", | ||
"geometry": { | ||
"type": "Polygon", | ||
"coordinates": [ | ||
[ | ||
[ | ||
-7.882190080512502, | ||
37.13739173208318 | ||
], | ||
[ | ||
-7.882190080512502, | ||
58.21798141355221 | ||
], | ||
[ | ||
27.911651652899925, | ||
58.21798141355221 | ||
], | ||
[ | ||
27.911651652899925, | ||
37.13739173208318 | ||
], | ||
[ | ||
-7.882190080512502, | ||
37.13739173208318 | ||
] | ||
] | ||
] | ||
}, | ||
"bbox": [ | ||
-7.882190080512502, | ||
37.13739173208318, | ||
27.911651652899923, | ||
58.21798141355221 | ||
], | ||
"properties": { | ||
"description": "Sourced from torchgeo python library, identifier is ResNet18_Weights.SENTINEL2_ALL_MOCO", | ||
"datetime": null, | ||
"start_datetime": "1900-01-01T00:00:00Z", | ||
"end_datetime": "9999-12-31T23:59:59Z", | ||
"mlm:name": "Resnet-18 Sentinel-2 ALL MOCO", | ||
"mlm:tasks": [ | ||
"classification" | ||
], | ||
"mlm:architecture": "ResNet", | ||
"mlm:framework": "pytorch", | ||
"mlm:framework_version": "2.1.2+cu121", | ||
"file:size": 43000000, | ||
"mlm:memory_size": 1, | ||
"mlm:total_parameters": 11700000, | ||
"mlm:pretrained_source": "EuroSat Sentinel-2", | ||
"mlm:accelerator": "cuda", | ||
"mlm:accelerator_constrained": false, | ||
"mlm:accelerator_summary": "Unknown", | ||
"mlm:batch_size_suggestion": 256, | ||
"mlm:input": [ | ||
{ | ||
"name": "RGB", | ||
"bands": [ | ||
"B04", | ||
"B03", | ||
"B02" | ||
], | ||
"input": { | ||
"shape": [ | ||
-1, | ||
3, | ||
64, | ||
64 | ||
], | ||
"dim_order": [ | ||
"batch", | ||
"channel", | ||
"height", | ||
"width" | ||
], | ||
"data_type": "uint16" | ||
}, | ||
"norm_by_channel": false, | ||
"norm_type": null, | ||
"resize_type": null | ||
}, | ||
{ | ||
"name": "NDVI", | ||
"bands": [ | ||
"B04", | ||
"B08" | ||
], | ||
"pre_processing_function": { | ||
"format": "gdal-calc", | ||
"expression": "(A - B) / (A + B)" | ||
}, | ||
"input": { | ||
"shape": [ | ||
-1, | ||
1, | ||
64, | ||
64 | ||
], | ||
"dim_order": [ | ||
"batch", | ||
"ndvi", | ||
"height", | ||
"width" | ||
], | ||
"data_type": "uint16" | ||
} | ||
} | ||
], | ||
"mlm:output": [ | ||
{ | ||
"name": "vegetation-segmentation", | ||
"tasks": [ | ||
"semantic-segmentation" | ||
], | ||
"result": { | ||
"shape": [ | ||
-1, | ||
1 | ||
], | ||
"dim_order": [ | ||
"batch", | ||
"class" | ||
], | ||
"data_type": "uint8" | ||
}, | ||
"classification_classes": [ | ||
{ | ||
"value": 0, | ||
"name": "NON_VEGETATION", | ||
"description": "background pixels", | ||
"color_hint": null | ||
}, | ||
{ | ||
"value": 1, | ||
"name": "VEGETATION", | ||
"description": "pixels where vegetation was detected", | ||
"color_hint": [0, 255, 0] | ||
} | ||
], | ||
"post_processing_function": null | ||
}, | ||
{ | ||
"name": "inverse-mask", | ||
"tasks": [ | ||
"semantic-segmentation" | ||
], | ||
"result": { | ||
"shape": [ | ||
-1, | ||
1 | ||
], | ||
"dim_order": [ | ||
"batch", | ||
"class" | ||
], | ||
"data_type": "uint8" | ||
}, | ||
"classification_classes": [ | ||
{ | ||
"value": 0, | ||
"name": "NON_VEGETATION", | ||
"description": "background pixels", | ||
"color_hint": [255, 255, 255] | ||
}, | ||
{ | ||
"value": 1, | ||
"name": "VEGETATION", | ||
"description": "pixels where vegetation was detected", | ||
"color_hint": [0, 0, 0] | ||
} | ||
], | ||
"post_processing_function": { | ||
"format": "gdal-calc", | ||
"expression": "logical_not(A)" | ||
} | ||
} | ||
], | ||
"raster:bands": [ | ||
{ | ||
"name": "B02 - blue", | ||
"nodata": 0, | ||
"data_type": "uint16", | ||
"bits_per_sample": 15, | ||
"spatial_resolution": 10, | ||
"scale": 0.0001, | ||
"offset": 0, | ||
"unit": "m" | ||
}, | ||
{ | ||
"name": "B03 - green", | ||
"nodata": 0, | ||
"data_type": "uint16", | ||
"bits_per_sample": 15, | ||
"spatial_resolution": 10, | ||
"scale": 0.0001, | ||
"offset": 0, | ||
"unit": "m" | ||
}, | ||
{ | ||
"name": "B04 - red", | ||
"nodata": 0, | ||
"data_type": "uint16", | ||
"bits_per_sample": 15, | ||
"spatial_resolution": 10, | ||
"scale": 0.0001, | ||
"offset": 0, | ||
"unit": "m" | ||
}, | ||
{ | ||
"name": "B08 - nir", | ||
"nodata": 0, | ||
"data_type": "uint16", | ||
"bits_per_sample": 15, | ||
"spatial_resolution": 10, | ||
"scale": 0.0001, | ||
"offset": 0, | ||
"unit": "m" | ||
} | ||
] | ||
}, | ||
"assets": { | ||
"weights": { | ||
"href": "https://huggingface.co/torchgeo/resnet50_sentinel2_rgb_moco/blob/main/resnet50_sentinel2_rgb_moco.pth", | ||
"title": "Pytorch weights checkpoint", | ||
"description": "A Resnet-50 classification model trained on Sentinel-2 RGB imagery with torchgeo.", | ||
"type": "application/octet-stream; application=pytorch", | ||
"roles": [ | ||
"mlm:model", | ||
"mlm:weights" | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.