Skip to content

Commit

Permalink
feat: add sicd integ tests (#5)
Browse files Browse the repository at this point in the history
* Update documentation.yaml

Swapping commit hash to specific version of peaceiris/actions-gh-pages

* Update documentation.yaml

Forgot 'v' in version for peaceiris/actions-gh-pages@

* Add integration tests for SICD

---------

Co-authored-by: douglas1850 <[email protected]>
  • Loading branch information
RanbirAulakh and douglas1850 authored Sep 9, 2023
1 parent b62bbcf commit cf30ce5
Show file tree
Hide file tree
Showing 7 changed files with 14,612 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
run: |
sphinx-build doc _build
- name: Deploy
uses: peaceiris/actions-gh-pages@f09b4d7e2f12f433806a6273c6b0025df1f7859d
uses: peaceiris/actions-gh-pages@v3.9.3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
Expand Down
3 changes: 3 additions & 0 deletions bin/process_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
"tile_ntf": f"s3://{image_bucket}/tile.ntf",
"tile_jpeg": f"s3://{image_bucket}/tile.jpeg",
"tile_png": f"s3://{image_bucket}/tile.png",
"sicd_capella_chip_ntf": f"s3://{image_bucket}/sicd-capella-chip.ntf",
"sicd_umbra_chip_ntf": f"s3://{image_bucket}/sicd-umbra-chip.ntf",
"sicd_interferometric_hh_ntf": f"s3://{image_bucket}/sicd-interferometric-hh.nitf"
}

# call into root directory of this package so that we can run this script from anywhere.
Expand Down
15 changes: 15 additions & 0 deletions bin/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ case $TARGET_IMAGE in
TARGET_IMAGE="s3://test-images-${ACCOUNT}/tile.png"
;;

"sicd_capella_chip_ntf")
TARGET_IMAGE="s3://test-images-${ACCOUNT}/sicd-capella-chip.ntf"
TEST_TILE_COMPRESSION=NONE
;;

"sicd_umbra_chip_ntf")
TARGET_IMAGE="s3://test-images-${ACCOUNT}/sicd-umbra-chip.ntf"
TEST_TILE_COMPRESSION=NONE
;;

"sicd_interferometric_hh_ntf")
TARGET_IMAGE="s3://test-images-${ACCOUNT}/sicd-interferometric-hh.nitf"
TEST_TILE_COMPRESSION=NONE
;;

esac

# Expected values from our CDK package
Expand Down
8 changes: 8 additions & 0 deletions src/aws/osml/utils/integ_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ def get_expected_image_feature_count(image: str) -> int:
return 99200
elif "tile" in image:
return 2
elif "sicd-capella-chip" in image or "sicd-umbra-chip" in image:
return 100
elif "sicd-interferometric" in image:
return 15300
else:
raise Exception(f"Could not determine expected features for image: {image}")

Expand Down Expand Up @@ -563,6 +567,10 @@ def get_expected_region_request_count(image: str) -> int:
expected_count = 49
elif "tile" in image:
expected_count = 1
elif "sicd-capella-chip" in image or "sicd-umbra-chip" in image:
expected_count = 1
elif "sicd-interferometric" in image:
expected_count = 8

# Check that we got a valid region request count
if expected_count != 0:
Expand Down
99 changes: 99 additions & 0 deletions src/data/centerpoint.sicd-capella-chip.ntf.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"bbox": [
109.68183257229833,
40.26362434768428,
109.68261187214613,
40.26429231898239
],
"id": "a3c358058d55761d0642a64055e5d80a",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
109.682612,
40.263764,
0
],
[
109.682278,
40.264292,
0
],
[
109.681833,
40.264153,
0
],
[
109.682167,
40.263624,
0
],
[
109.682612,
40.263764,
0
]
]
]
},
"properties": {
"detection": {
"type": "Polygon",
"pixelCoordinates": [
[
204.8,
204.8
],
[
204.8,
307.2
],
[
307.2,
307.2
],
[
307.2,
204.8
]
],
"ontology": [
{
"iri": "sample_object",
"detectionScore": 1
}
],
"coordinates": []
},
"center_longitude": 109.68222222222224,
"center_latitude": 40.263958333333335,
"inferenceMetadata": {
"jobId": "a007cb086b65219a72b5cd5a58e945e2",
"filePath": "s3://test-images-825536440648/capella-sicd121-chip1.ntf",
"receiveTime": "2023-09-07T23:31:24.937142",
"inferenceTime": "2023-09-07T23:31:25.683975+00:00",
"tileOverlapFeatureSelection": "{\"algorithm\": \"NMS\", \"iou_threshold\": 0.75, \"skip_box_threshold\": 0.0001, \"sigma\": 0.1}"
},
"source": [
{
"fileType": "NITF",
"info": {
"imageCategory": "SAR",
"metadata": {
"sourceId": "",
"sourceDt": "2002-12-16T15:16:29",
"classification": "UNCLASSIFIED"
}
}
}
]
}
}
]
}
Loading

0 comments on commit cf30ce5

Please sign in to comment.