blue-sandbox 5.292.1__py3-none-any.whl → 5.318.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blue_sandbox/.abcli/alias.sh +2 -0
- blue_sandbox/.abcli/tests/help.sh +0 -8
- blue_sandbox/README.py +6 -51
- blue_sandbox/__init__.py +1 -1
- blue_sandbox/config.env +3 -1
- blue_sandbox/env.py +7 -0
- blue_sandbox/help/functions.py +0 -10
- blue_sandbox/sample.env +2 -1
- {blue_sandbox-5.292.1.dist-info → blue_sandbox-5.318.1.dist-info}/METADATA +2 -10
- blue_sandbox-5.318.1.dist-info/RECORD +28 -0
- blue_sandbox/.abcli/cemetery/inference/cloudwatch.sh +0 -40
- blue_sandbox/.abcli/cemetery/inference/inference.sh +0 -155
- blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest/list.sh +0 -21
- blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest.sh +0 -76
- blue_sandbox/.abcli/microsoft_building_damage_assessment/install.sh +0 -50
- blue_sandbox/.abcli/microsoft_building_damage_assessment/label.sh +0 -26
- blue_sandbox/.abcli/microsoft_building_damage_assessment/tensorboard.sh +0 -21
- blue_sandbox/.abcli/microsoft_building_damage_assessment/train.sh +0 -53
- blue_sandbox/.abcli/microsoft_building_damage_assessment.sh +0 -15
- blue_sandbox/.abcli/sagesemseg/cache_dataset.sh +0 -49
- blue_sandbox/.abcli/sagesemseg/consts.sh +0 -3
- blue_sandbox/.abcli/sagesemseg/train.sh +0 -48
- blue_sandbox/.abcli/sagesemseg/upload_dataset.sh +0 -47
- blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest.sh +0 -13
- blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest_list.sh +0 -19
- blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_label.sh +0 -12
- blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_train.sh +0 -20
- blue_sandbox/.abcli/tests/sagesemseg_train.sh +0 -29
- blue_sandbox/list.py +0 -37
- blue_sandbox/microsoft_building_damage_assessment/README.py +0 -45
- blue_sandbox/microsoft_building_damage_assessment/__init__.py +0 -0
- blue_sandbox/microsoft_building_damage_assessment/__main__.py +0 -82
- blue_sandbox/microsoft_building_damage_assessment/ingest.py +0 -31
- blue_sandbox/microsoft_building_damage_assessment/label.py +0 -38
- blue_sandbox/microsoft_building_damage_assessment/sas_token.py +0 -9
- blue_sandbox/microsoft_building_damage_assessment/train.py +0 -95
- blue_sandbox-5.292.1.dist-info/RECORD +0 -54
- {blue_sandbox-5.292.1.dist-info → blue_sandbox-5.318.1.dist-info}/LICENSE +0 -0
- {blue_sandbox-5.292.1.dist-info → blue_sandbox-5.318.1.dist-info}/WHEEL +0 -0
- {blue_sandbox-5.292.1.dist-info → blue_sandbox-5.318.1.dist-info}/top_level.txt +0 -0
blue_sandbox/.abcli/alias.sh
CHANGED
@@ -7,14 +7,6 @@ function test_blue_sandbox_help() {
|
|
7
7
|
for module in \
|
8
8
|
"@sandbox" \
|
9
9
|
\
|
10
|
-
"@damages" \
|
11
|
-
"@damages ingest" \
|
12
|
-
"@damages ingest list" \
|
13
|
-
"@damages install" \
|
14
|
-
"@damages label" \
|
15
|
-
"@damages tensorboard" \
|
16
|
-
"@damages train" \
|
17
|
-
\
|
18
10
|
"blue_sandbox"; do
|
19
11
|
abcli_eval ,$options \
|
20
12
|
abcli_help $module
|
blue_sandbox/README.py
CHANGED
@@ -1,60 +1,15 @@
|
|
1
1
|
import os
|
2
2
|
|
3
3
|
from blue_objects import file, README
|
4
|
-
from blue_options.help.functions import get_help
|
5
4
|
|
6
5
|
from blue_sandbox import NAME, VERSION, ICON, REPO_NAME
|
7
|
-
from blue_sandbox.microsoft_building_damage_assessment import (
|
8
|
-
README as microsoft_building_damage_assessment_README,
|
9
|
-
)
|
10
|
-
from blue_sandbox.list import list_of_experiments
|
11
|
-
|
12
|
-
items = [
|
13
|
-
"{}[`{}`]({}) {} []({}) {}".format(
|
14
|
-
experiment["ICON"],
|
15
|
-
experiment_name,
|
16
|
-
experiment["url"],
|
17
|
-
experiment["status"],
|
18
|
-
experiment["marquee"],
|
19
|
-
experiment["url"],
|
20
|
-
experiment["title"],
|
21
|
-
)
|
22
|
-
for experiment_name, experiment in list_of_experiments.items()
|
23
|
-
if experiment_name != "template"
|
24
|
-
]
|
25
6
|
|
26
7
|
|
27
8
|
def build():
|
28
|
-
return
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
ICON=ICON,
|
35
|
-
NAME=NAME,
|
36
|
-
VERSION=VERSION,
|
37
|
-
REPO_NAME=REPO_NAME,
|
38
|
-
)
|
39
|
-
for thing in (
|
40
|
-
[
|
41
|
-
{
|
42
|
-
"items": items,
|
43
|
-
"path": "..",
|
44
|
-
},
|
45
|
-
{
|
46
|
-
"items": microsoft_building_damage_assessment_README.items,
|
47
|
-
"cols": len(
|
48
|
-
microsoft_building_damage_assessment_README.list_of_steps
|
49
|
-
),
|
50
|
-
"path": "microsoft_building_damage_assessment",
|
51
|
-
},
|
52
|
-
{
|
53
|
-
"path": "cemetery",
|
54
|
-
},
|
55
|
-
{
|
56
|
-
"path": "sagesemseg",
|
57
|
-
},
|
58
|
-
]
|
59
|
-
)
|
9
|
+
return README.build(
|
10
|
+
path=os.path.join(file.path(__file__), ".."),
|
11
|
+
ICON=ICON,
|
12
|
+
NAME=NAME,
|
13
|
+
VERSION=VERSION,
|
14
|
+
REPO_NAME=REPO_NAME,
|
60
15
|
)
|
blue_sandbox/__init__.py
CHANGED
blue_sandbox/config.env
CHANGED
@@ -2,4 +2,6 @@ DAMAGES_TEST_DATASET_OBJECT_NAME=Maui-Hawaii-fires-Aug-23-ingest-2025-01-10-qqJq
|
|
2
2
|
|
3
3
|
SAGESEMSEG_COMPLETED_JOB_pascal_voc_v1_debug_v2=sagesemseg-model-2025-01-11-22-00-08-bW-2025-01-12-06-00-08-928
|
4
4
|
|
5
|
-
SAGESEMSEG_COMPLETED_JOB_pascal_voc_v1_full_v2=sagesemseg-model-2025-01-12-15-52-20-ly-2025-01-12-23-52-20-582
|
5
|
+
SAGESEMSEG_COMPLETED_JOB_pascal_voc_v1_full_v2=sagesemseg-model-2025-01-12-15-52-20-ly-2025-01-12-23-52-20-582
|
6
|
+
|
7
|
+
VISUALYZE_PORT=8080
|
blue_sandbox/env.py
CHANGED
blue_sandbox/help/functions.py
CHANGED
@@ -2,15 +2,5 @@ from abcli.help.generic import help_functions as generic_help_functions
|
|
2
2
|
|
3
3
|
from blue_sandbox import ALIAS
|
4
4
|
|
5
|
-
from blue_sandbox.help.microsoft_building_damage_assessment import (
|
6
|
-
help_functions as help_microsoft_building_damage_assessment,
|
7
|
-
)
|
8
|
-
|
9
5
|
|
10
6
|
help_functions = generic_help_functions(plugin_name=ALIAS)
|
11
|
-
|
12
|
-
help_functions.update(
|
13
|
-
{
|
14
|
-
"microsoft_building_damage_assessment": help_microsoft_building_damage_assessment,
|
15
|
-
}
|
16
|
-
)
|
blue_sandbox/sample.env
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
ENCODED_BLOB_SAS_TOKEN=value
|
1
|
+
ENCODED_BLOB_SAS_TOKEN=value
|
2
|
+
GROQ_API_KEY=
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: blue_sandbox
|
3
|
-
Version: 5.
|
3
|
+
Version: 5.318.1
|
4
4
|
Summary: 🌀 A sandbox for ideas and experiments.
|
5
5
|
Home-page: https://github.com/kamangir/blue-sandbox
|
6
6
|
Author: Arash Abadpour (Kamangir)
|
@@ -32,10 +32,6 @@ Requires-Dist: pylint
|
|
32
32
|
Requires-Dist: pytest
|
33
33
|
Requires-Dist: python-dotenv[cli]
|
34
34
|
Requires-Dist: tqdm
|
35
|
-
Requires-Dist: azure-storage-blob
|
36
|
-
Requires-Dist: fiona
|
37
|
-
Requires-Dist: tensorboard
|
38
|
-
Requires-Dist: sagemaker<3,>=2
|
39
35
|
Dynamic: author
|
40
36
|
Dynamic: author-email
|
41
37
|
Dynamic: classifier
|
@@ -54,14 +50,10 @@ Dynamic: summary
|
|
54
50
|
pip install blue-sandbox
|
55
51
|
```
|
56
52
|
|
57
|
-
| | |
|
58
|
-
| --- | --- |
|
59
|
-
| 🧑🏽🚒[`palisades`](https://github.com/kamangir/palisades) 🎓 [](https://github.com/kamangir/palisades) Geospatial AI for Post-Disaster Damage Assessment using Maxar Open Data. | 🌀[`sagesemseg`](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/sagesemseg/README.md) ⏸️ [](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/sagesemseg/README.md) A SemSeg (Semantic Segmenter) trained and deployed on AWS Sagemaker. |
|
60
|
-
| 🌐[``@damages``](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) ⏸️ [](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) Satellite imagery damage assessment workflow | 🪦[`cemetery`](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/cemetery/README.md) 🪦 [](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/cemetery/README.md) An AI cemetery. |
|
61
53
|
|
62
54
|
---
|
63
55
|
|
64
56
|
|
65
57
|
[](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml) [](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml) [](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml) [](https://pypi.org/project/blue-sandbox/) [](https://pypistats.org/packages/blue-sandbox)
|
66
58
|
|
67
|
-
built by 🌀 [`blue_options-4.
|
59
|
+
built by 🌀 [`blue_options-4.202.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.318.1`](https://github.com/kamangir/blue-sandbox).
|
@@ -0,0 +1,28 @@
|
|
1
|
+
blue_sandbox/README.py,sha256=0-5yDVr9YjmE-PfwJUiwzm2vU_t6CPMg81lK-08Ti_8,298
|
2
|
+
blue_sandbox/__init__.py,sha256=YAGosuIdPY-SgwCPop0IE_XfK8AuHoR1m90d9mInBWY,323
|
3
|
+
blue_sandbox/__main__.py,sha256=aPRHSpGpk-bDbzhHpfLNsd3y1gGEHpnhoTF-RBweNwc,361
|
4
|
+
blue_sandbox/config.env,sha256=TMUch2y2XZcLEonfpb-VXFFCuFdyD_6TTgtOrBAqqs0,329
|
5
|
+
blue_sandbox/env.py,sha256=jXFVGqvLPXeapU6ziawXYfvtsT4ervHnUq2MhPtLsuU,626
|
6
|
+
blue_sandbox/functions.py,sha256=U41kQFNPpfYV6KJpMnkqgqLkozqXiG4tgV6rj8IW1BU,7
|
7
|
+
blue_sandbox/host.py,sha256=uJpiM105rnm6ySF16zA7waWekGBdec-dlpoRRU_QqwU,210
|
8
|
+
blue_sandbox/logger.py,sha256=ZoFrTIfJJGNtZUm2d7lkQjdB2SPl_KBKDmHJOcIivPM,107
|
9
|
+
blue_sandbox/sample.env,sha256=qtSmtvFB1SITG4XaG5dT45YWvGZgOW1_DJZf-WUTUXo,42
|
10
|
+
blue_sandbox/urls.py,sha256=tIZ36ONJEoUBM-tFhOpkVhLwb1OgLegUeEaBDqW4USM,24
|
11
|
+
blue_sandbox/.abcli/abcli.sh,sha256=xsJ4IzuQsvLZog6U8VTBFVXsEi6ADe13L8rn47XtlbU,196
|
12
|
+
blue_sandbox/.abcli/actions.sh,sha256=vImEUI105GRcxs2mAKGMqcvoErtmOPZZ-7dfSmUUxvE,230
|
13
|
+
blue_sandbox/.abcli/aka.sh,sha256=RHDU_JbEEL2B0vvvRJ3NVSsRSEjSu09jNY85n7DLe-k,21
|
14
|
+
blue_sandbox/.abcli/alias.sh,sha256=iO0wZPVClb6I_zRUJijXwtpVqJFIJSJ6E-sKlDEUsdE,189
|
15
|
+
blue_sandbox/.abcli/blue_sandbox.sh,sha256=PGRJOgNGlC3XL5cw4ecZH40LDuc_6NVazTKhCWtZ-3g,233
|
16
|
+
blue_sandbox/.abcli/browse.sh,sha256=f8qa4qDVts2Am6_ldDwNeJXzhBQTk9PUKl0-a9wW1ww,287
|
17
|
+
blue_sandbox/.abcli/install.sh,sha256=zvl0GsHBmfw62ORmkMlhug264N_Zr8nc3rlPGFoq7Mk,125
|
18
|
+
blue_sandbox/.abcli/tests/README.sh,sha256=rmJM-BPnTcmpPbJ5GXsF8vd_a84JKryeKkZyVScUing,145
|
19
|
+
blue_sandbox/.abcli/tests/help.sh,sha256=Di6Bp4oL3le3qJ0EkL-jeBDU50GWwrcoHgEAZiT6is0,315
|
20
|
+
blue_sandbox/.abcli/tests/version.sh,sha256=jF8zoJN1eKE3LfDeRVG9uHEosmEVJX6RtKfdioyeN-o,150
|
21
|
+
blue_sandbox/help/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
22
|
+
blue_sandbox/help/__main__.py,sha256=3Cqp5oISrZCOUApmwoQoCj_0sQgtkiEkm_ob3LFKzRE,234
|
23
|
+
blue_sandbox/help/functions.py,sha256=6pqjFj4iQYWuRyhmEKe-ErPCZW963n-Q1AdfNbfeQos,165
|
24
|
+
blue_sandbox-5.318.1.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
|
25
|
+
blue_sandbox-5.318.1.dist-info/METADATA,sha256=FxwHPggLkxGFRbNEpgwkQIaD1pt6Hv_Ny6vbs4dYTnM,2162
|
26
|
+
blue_sandbox-5.318.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
27
|
+
blue_sandbox-5.318.1.dist-info/top_level.txt,sha256=4D9Cb9QUCaqdYAmBiCwvtlaYBtUYVVxv0Sxcr_pzgS8,13
|
28
|
+
blue_sandbox-5.318.1.dist-info/RECORD,,
|
@@ -1,40 +0,0 @@
|
|
1
|
-
#! /usr/bin/env bash
|
2
|
-
|
3
|
-
function cloudwatch() {
|
4
|
-
blue_sandbox_cemetery_cloudwatch "$@"
|
5
|
-
}
|
6
|
-
|
7
|
-
function blue_sandbox_cemetery_cloudwatch() {
|
8
|
-
local task=${1:=help}
|
9
|
-
|
10
|
-
if [ "$task" == "help" ]; then
|
11
|
-
local options="endpoint"
|
12
|
-
abcli_show_usage "cloudwatch browse$EOP$ABCUL[$options]$ABCUL[<endpoint-name>]$EOPE" \
|
13
|
-
"browse endpoint on cloudwatch." \
|
14
|
-
"default endpoint: $(blue_sandbox_cemetery_inference_default_endpoint)"
|
15
|
-
return
|
16
|
-
fi
|
17
|
-
|
18
|
-
local options=$2
|
19
|
-
|
20
|
-
# https://docs.aws.amazon.com/sagemaker/latest/dg/logging-cloudwatch.html
|
21
|
-
if [ "$task" == "browse" ]; then
|
22
|
-
local object_type=$(abcli_option_choice "$options" endpoint endpoint)
|
23
|
-
|
24
|
-
local url=""
|
25
|
-
if [[ "$object_type" == endpoint ]]; then
|
26
|
-
local endpoint_name=$(abcli_clarify_input $3 $(blue_sandbox_cemetery_inference_default_endpoint))
|
27
|
-
abcli_log "🔗 endpoint: $endpoint_name"
|
28
|
-
url="https://$ABCLI_AWS_REGION.console.aws.amazon.com/cloudwatch/home?region=$ABCLI_AWS_REGION#logEventViewer:group=/aws/sagemaker/Endpoints/$endpoint_name"
|
29
|
-
else
|
30
|
-
abcli_log_error "-cloudwatch: $task: $object_type: object type not found."
|
31
|
-
return 1
|
32
|
-
fi
|
33
|
-
|
34
|
-
abcli_browse $url
|
35
|
-
return
|
36
|
-
fi
|
37
|
-
|
38
|
-
abcli_log_error "blue_sandbox: cemetery: cloudwatch: $task: command not found."
|
39
|
-
return 1
|
40
|
-
}
|
@@ -1,155 +0,0 @@
|
|
1
|
-
#! /usr/bin/env bash
|
2
|
-
|
3
|
-
function blue_sandbox_cemetery_inference() {
|
4
|
-
local task=$(abcli_unpack_keyword $1 help)
|
5
|
-
|
6
|
-
if [ "$task" == "help" ]; then
|
7
|
-
for task in create delete describe invoke list pull; do
|
8
|
-
blue_sandbox_cemetery_inference "$task" "$@"
|
9
|
-
done
|
10
|
-
return
|
11
|
-
fi
|
12
|
-
local options=$2
|
13
|
-
|
14
|
-
if [ $(abcli_option_int "$options" help 0) == 1 ]; then
|
15
|
-
case $task in
|
16
|
-
"create")
|
17
|
-
local args="[--verbose 1]$ABCUL[--verify 0]"
|
18
|
-
local options="dryrun,model"
|
19
|
-
abcli_show_usage "@cemetery inference create$ABCUL[$options]$ABCUL[.|<object-name>]$ABCUL$args" \
|
20
|
-
"create inference model."
|
21
|
-
|
22
|
-
local options="dryrun,endpoint_config,suffix=<suffix>"
|
23
|
-
abcli_show_usage "@cemetery inference create$ABCUL[$options]$ABCUL[.|<object-name>]$ABCUL$args" \
|
24
|
-
"create inference endpoint config."
|
25
|
-
|
26
|
-
local options="dryrun,endpoint,config_suffix=<suffix>,suffix=<suffix>"
|
27
|
-
abcli_show_usage "@cemetery inference create$ABCUL[$options]$ABCUL[.|<object-name>]$ABCUL$args" \
|
28
|
-
"create inference endpoint."
|
29
|
-
;;
|
30
|
-
"delete")
|
31
|
-
local args="[--verbose 1]"
|
32
|
-
local options="dryrun,model|endpoint_config|endpoint"
|
33
|
-
abcli_show_usage "@cemetery inference delete$ABCUL[$options]$ABCUL<name>$ABCUL$args" \
|
34
|
-
"delete inference object."
|
35
|
-
;;
|
36
|
-
"describe")
|
37
|
-
local args="[--verbose 1]"
|
38
|
-
local options="dryrun,endpoint"
|
39
|
-
abcli_show_usage "@cemetery inference describe$ABCUL[$options]$ABCUL<name>$ABCUL$args" \
|
40
|
-
"describe inference endpoint."
|
41
|
-
;;
|
42
|
-
"invoke")
|
43
|
-
local args="[--verbose 1]"
|
44
|
-
local options="~download,dryrun,profile=$semseg_profiles,upload"
|
45
|
-
abcli_show_usage "@cemetery inference invoke$EOP$ABCUL[$options]$ABCUL[-|<endpoint-name>]$ABCUL[..|<dataset-object-name>]$ABCUL[-|<prediction-object-name>]$ABCUL$args$EOPE" \
|
46
|
-
"<dataset-object-name> -> inference endpoint -> <prediction-object-name>." \
|
47
|
-
"default endpoint: $(blue_sandbox_cemetery_inference_default_endpoint)"
|
48
|
-
;;
|
49
|
-
"list")
|
50
|
-
local args="[--verbose 1]"
|
51
|
-
local options="dryrun,model|endpoint_config|endpoint,contains=<string>"
|
52
|
-
abcli_show_usage "@cemetery inference list$ABCUL[$options]$ABCUL$args" \
|
53
|
-
"list inference objects."
|
54
|
-
;;
|
55
|
-
"pull")
|
56
|
-
local options="dryrun"
|
57
|
-
abcli_show_usage "@cemetery inference pull$ABCUL[$options]" \
|
58
|
-
"pull the inference image."
|
59
|
-
;;
|
60
|
-
esac
|
61
|
-
return
|
62
|
-
fi
|
63
|
-
|
64
|
-
if [[ ",create,delete,describe,list," == *",$task,"* ]]; then
|
65
|
-
local object_type=$(abcli_option_choice "$options" model,endpoint_config,endpoint model)
|
66
|
-
local do_dryrun=$(abcli_option_int "$options" dryrun 0)
|
67
|
-
fi
|
68
|
-
|
69
|
-
if [[ "$task" == "create" ]]; then
|
70
|
-
local object_name=$(abcli_clarify_object $3 .)
|
71
|
-
|
72
|
-
[[ "$object_type" == "model" ]] &&
|
73
|
-
abcli_upload solid,~warn_if_exists $object_name
|
74
|
-
|
75
|
-
abcli_eval dryrun=$do_dryrun \
|
76
|
-
python3 -m blue_sandbox.cemetry.inference create \
|
77
|
-
--suffix $(abcli_option "$options" suffix -) \
|
78
|
-
--config_suffix $(abcli_option "$options" config_suffix -) \
|
79
|
-
--object_type "$object_type" \
|
80
|
-
--object_name "$object_name" \
|
81
|
-
"${@:4}"
|
82
|
-
return
|
83
|
-
fi
|
84
|
-
|
85
|
-
if [[ ",delete,describe," == *",$task,"* ]]; then
|
86
|
-
abcli_eval dryrun=$do_dryrun \
|
87
|
-
python3 -m blue_sandbox.cemetry.inference $task \
|
88
|
-
--object_type "$object_type" \
|
89
|
-
--object_name "$3" \
|
90
|
-
"${@:4}"
|
91
|
-
return
|
92
|
-
fi
|
93
|
-
|
94
|
-
if [[ "$task" == "invoke" ]]; then
|
95
|
-
local do_dryrun=$(abcli_option_int "$options" dryrun 0)
|
96
|
-
local do_download=$(abcli_option_int "$options" download $(abcli_not $do_dryrun))
|
97
|
-
local do_upload=$(abcli_option_int "$options" upload $(abcli_not $do_dryrun))
|
98
|
-
|
99
|
-
local endpoint_name=$(abcli_clarify_input $3 $(blue_sandbox_cemetery_inference_default_endpoint))
|
100
|
-
|
101
|
-
local dataset_object_name=$(abcli_clarify_object $4 ..)
|
102
|
-
[[ "$do_download" == 1 ]] &&
|
103
|
-
abcli_download - $dataset_object_name
|
104
|
-
|
105
|
-
local prediction_object_name=$(abcli_clarify_object $5 $(abcli_string_timestamp))
|
106
|
-
|
107
|
-
abcli_log "endpoint[$endpoint_name].invoke($dataset_object_name) -> $prediction_object_name."
|
108
|
-
|
109
|
-
abcli_eval dryrun=$do_dryrun \
|
110
|
-
python3 -m blue_sandbox.cemetry.inference $task \
|
111
|
-
--endpoint_name $endpoint_name \
|
112
|
-
--dataset_path $ABCLI_OBJECT_ROOT/$dataset_object_name \
|
113
|
-
--prediction_path $ABCLI_OBJECT_ROOT/$prediction_object_name \
|
114
|
-
--profile $(abcli_option "$options" profile VALIDATION) \
|
115
|
-
"${@:6}"
|
116
|
-
|
117
|
-
[[ "$do_upload" == 1 ]] &&
|
118
|
-
abcli_upload - $prediction_object_name
|
119
|
-
|
120
|
-
return
|
121
|
-
fi
|
122
|
-
|
123
|
-
if [[ "$task" == "list" ]]; then
|
124
|
-
abcli_eval dryrun=$do_dryrun \
|
125
|
-
python3 -m blue_sandbox.cemetry.inference $task \
|
126
|
-
--object_type "$object_type" \
|
127
|
-
--object_name $(abcli_option "$options" contains -) \
|
128
|
-
"${@:3}"
|
129
|
-
return
|
130
|
-
fi
|
131
|
-
|
132
|
-
if [ "$task" == "pull" ]; then
|
133
|
-
aws ecr get-login-password \
|
134
|
-
--region $ABCLI_AWS_REGION |
|
135
|
-
docker login \
|
136
|
-
--username AWS \
|
137
|
-
--password-stdin \
|
138
|
-
763104351884.dkr.ecr.$ABCLI_AWS_REGION.amazonaws.com
|
139
|
-
[[ $? -ne 0 ]] && return 1
|
140
|
-
|
141
|
-
local image_name=$(python3 -m blue_sandbox.cemetry.inference.image get --what name)
|
142
|
-
abcli_log "🔗 image name: $image_name"
|
143
|
-
abcli_eval dryrun=$do_dryrun \
|
144
|
-
docker pull $image_name
|
145
|
-
|
146
|
-
return
|
147
|
-
fi
|
148
|
-
|
149
|
-
abcli_log_error "@cemetery: inference: $task: command not found."
|
150
|
-
return 1
|
151
|
-
}
|
152
|
-
|
153
|
-
function blue_sandbox_cemetery_inference_default_endpoint() {
|
154
|
-
echo endpoint-$(abcli_cache read blue_sandbox_cemetery_semseg_model_AIRS_o2)-pytorch
|
155
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
#! /usr/bin/env bash
|
2
|
-
|
3
|
-
function blue_sandbox_microsoft_building_damage_assessment_ingest_list() {
|
4
|
-
local options=$1
|
5
|
-
local event_name=$(abcli_option "$options" event all)
|
6
|
-
|
7
|
-
local suffix=$2
|
8
|
-
|
9
|
-
local url="s3://maxar-opendata/events/"
|
10
|
-
|
11
|
-
[[ "$event_name" != all ]] &&
|
12
|
-
url="$url$event_name/ard/"
|
13
|
-
|
14
|
-
[[ ! -z "$suffix" ]] &&
|
15
|
-
url="$url$suffix"
|
16
|
-
|
17
|
-
abcli_eval ,$options \
|
18
|
-
aws s3 ls --no-sign-request $url
|
19
|
-
|
20
|
-
return 0
|
21
|
-
}
|
@@ -1,76 +0,0 @@
|
|
1
|
-
#! /usr/bin/env bash
|
2
|
-
|
3
|
-
function blue_sandbox_microsoft_building_damage_assessment_ingest() {
|
4
|
-
local options=$1
|
5
|
-
|
6
|
-
local show_list=$(abcli_option_int "$options" list 0)
|
7
|
-
if [[ "$show_list" == 1 ]]; then
|
8
|
-
blue_sandbox_microsoft_building_damage_assessment_ingest_list "${@:2}"
|
9
|
-
return
|
10
|
-
fi
|
11
|
-
|
12
|
-
local do_dryrun=$(abcli_option_int "$options" dryrun 0)
|
13
|
-
local do_download=$(abcli_option_int "$options" download $(abcli_not $do_dryrun))
|
14
|
-
local do_gdal=$(abcli_option_int "$options" gdal 1)
|
15
|
-
local do_rm=$(abcli_option_int "$options" rm 1)
|
16
|
-
local do_upload=$(abcli_option_int "$options" upload $(abcli_not $do_dryrun))
|
17
|
-
local event_name=$(abcli_option "$options" event default)
|
18
|
-
|
19
|
-
local object_name=$(abcli_clarify_object $2 $event_name-ingest-$(abcli_string_timestamp_short))
|
20
|
-
|
21
|
-
abcli_log "ingesting $event_name -> $object_name ..."
|
22
|
-
|
23
|
-
local object_path=$ABCLI_OBJECT_ROOT/$object_name
|
24
|
-
mkdir -pv $object_path
|
25
|
-
|
26
|
-
pushd $object_path >/dev/null
|
27
|
-
|
28
|
-
# https://github.com/microsoft/building-damage-assessment/blob/main/SATELLITE_WORKFLOW.md#1-image-acquisition-and-label-generation
|
29
|
-
mkdir -pv raw
|
30
|
-
cd raw
|
31
|
-
|
32
|
-
if [[ "$do_download" == 1 ]]; then
|
33
|
-
# TODO: use $event_name and $count (options +=)
|
34
|
-
|
35
|
-
abcli_eval ,$options \
|
36
|
-
wget https://maxar-opendata.s3.amazonaws.com/events/Maui-Hawaii-fires-Aug-23/ard/04/122000330002/2023-08-12/10300100EB15FF00-visual.tif
|
37
|
-
[[ $? -ne 0 ]] && return 1
|
38
|
-
|
39
|
-
abcli_eval ,$options \
|
40
|
-
wget https://maxar-opendata.s3.amazonaws.com/events/Maui-Hawaii-fires-Aug-23/ard/04/122000330020/2023-08-12/10300100EB15FF00-visual.tif
|
41
|
-
[[ $? -ne 0 ]] && return 1
|
42
|
-
fi
|
43
|
-
|
44
|
-
if [[ "$do_gdal" == 1 ]]; then
|
45
|
-
abcli_eval ,$options \
|
46
|
-
gdalbuildvrt maxar_lahaina_8_12_2023-visual.vrt *.tif*
|
47
|
-
[[ $? -ne 0 ]] && return 1
|
48
|
-
|
49
|
-
abcli_eval ,$options \
|
50
|
-
gdalwarp -co BIGTIFF=YES -co NUM_THREADS=ALL_CPUS -co COMPRESS=LZW -co PREDICTOR=2 -of COG maxar_lahaina_8_12_2023-visual.vrt maxar_lahaina_8_12_2023-visual.tif
|
51
|
-
[[ $? -ne 0 ]] && return 1
|
52
|
-
fi
|
53
|
-
|
54
|
-
if [[ "$do_rm" == 1 ]]; then
|
55
|
-
abcli_log "removing raw data ..."
|
56
|
-
rm -v 10300100EB15FF00-visual.tif*
|
57
|
-
rm -v maxar_lahaina_8_12_2023-visual.vrt
|
58
|
-
fi
|
59
|
-
|
60
|
-
popd >/dev/null
|
61
|
-
|
62
|
-
abcli_eval dryrun=$do_dryrun \
|
63
|
-
python3 -m blue_sandbox.microsoft_building_damage_assessment \
|
64
|
-
ingest \
|
65
|
-
--event_name $event_name \
|
66
|
-
--object_name $object_name \
|
67
|
-
"${@:3}"
|
68
|
-
local status="$?"
|
69
|
-
|
70
|
-
[[ "$do_upload" == 1 ]] &&
|
71
|
-
abcli_upload - $object_name
|
72
|
-
|
73
|
-
return $status
|
74
|
-
}
|
75
|
-
|
76
|
-
abcli_source_caller_suffix_path /ingest
|
@@ -1,50 +0,0 @@
|
|
1
|
-
#! /usr/bin/env bash
|
2
|
-
|
3
|
-
function blue_sandbox_microsoft_building_damage_assessment_install() {
|
4
|
-
local options=$1
|
5
|
-
local do_dryrun=$(abcli_option_int "$options" dryrun 0)
|
6
|
-
local recreate_env=$(abcli_option_int "$options" recreate_env 0)
|
7
|
-
|
8
|
-
if [[ -d "$abcli_path_git/building-damage-assessment" ]]; then
|
9
|
-
abcli_log "✅ building-damage-assessment"
|
10
|
-
else
|
11
|
-
abcli_git_clone https://github.com/microsoft/building-damage-assessment.git
|
12
|
-
[[ $? -ne 0 ]] && return 1
|
13
|
-
fi
|
14
|
-
|
15
|
-
[[ "$abcli_is_github_workflow" == true ]] ||
|
16
|
-
[[ "$abcli_is_sagemaker_system" == true ]] &&
|
17
|
-
return 0
|
18
|
-
|
19
|
-
if [[ "$recreate_env" == 1 ]]; then
|
20
|
-
abcli_conda_rm name=bda
|
21
|
-
[[ $? -ne 0 ]] && return 1
|
22
|
-
fi
|
23
|
-
|
24
|
-
local exists=$(abcli_conda_exists name=bda)
|
25
|
-
if [[ "$exists" == 0 ]]; then
|
26
|
-
# https://github.com/microsoft/building-damage-assessment?tab=readme-ov-file#setup
|
27
|
-
conda env create \
|
28
|
-
-f $abcli_path_git/building-damage-assessment/environment.yml
|
29
|
-
[[ $? -ne 0 ]] && return 1
|
30
|
-
fi
|
31
|
-
|
32
|
-
conda activate bda
|
33
|
-
[[ $? -ne 0 ]] && return 1
|
34
|
-
|
35
|
-
pushd $abcli_path_git/blue-sandbox >/dev/null
|
36
|
-
pip3 install -e .
|
37
|
-
[[ $? -ne 0 ]] && return 1
|
38
|
-
popd >/dev/null
|
39
|
-
|
40
|
-
[[ "$abcli_is_mac" == true ]] &&
|
41
|
-
brew install wget
|
42
|
-
|
43
|
-
return 0
|
44
|
-
}
|
45
|
-
|
46
|
-
function abcli_install_microsoft_building_damage_assessment() {
|
47
|
-
blue_sandbox_microsoft_building_damage_assessment_install "$@"
|
48
|
-
}
|
49
|
-
|
50
|
-
abcli_install_module microsoft_building_damage_assessment 1.1.1
|
@@ -1,26 +0,0 @@
|
|
1
|
-
#! /usr/bin/env bash
|
2
|
-
|
3
|
-
function blue_sandbox_microsoft_building_damage_assessment_label() {
|
4
|
-
local options=$1
|
5
|
-
local do_dryrun=$(abcli_option_int "$options" dryrun 0)
|
6
|
-
local do_download=$(abcli_option_int "$options" download $(abcli_not $do_dryrun))
|
7
|
-
local do_upload=$(abcli_option_int "$options" upload $(abcli_not $do_dryrun))
|
8
|
-
|
9
|
-
local object_name=$(abcli_clarify_object $2 .)
|
10
|
-
[[ "$do_download" == 1 ]] &&
|
11
|
-
abcli_download - $object_name
|
12
|
-
|
13
|
-
abcli_log "labeling $object_name ..."
|
14
|
-
|
15
|
-
abcli_eval dryrun=$do_dryrun \
|
16
|
-
python3 -m blue_sandbox.microsoft_building_damage_assessment \
|
17
|
-
label \
|
18
|
-
--object_name $object_name \
|
19
|
-
"${@:3}"
|
20
|
-
local status="$?"
|
21
|
-
|
22
|
-
[[ "$do_upload" == 1 ]] &&
|
23
|
-
abcli_upload - $object_name
|
24
|
-
|
25
|
-
return $status
|
26
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
#! /usr/bin/env bash
|
2
|
-
|
3
|
-
function blue_sandbox_microsoft_building_damage_assessment_tensorboard() {
|
4
|
-
local options=$1
|
5
|
-
local do_dryrun=$(abcli_option_int "$options" dryrun 0)
|
6
|
-
local do_browse=$(abcli_option_int "$options" browse $(abcli_not $do_dryrun))
|
7
|
-
local do_download=$(abcli_option_int "$options" download $(abcli_not $do_dryrun))
|
8
|
-
local port=$(abcli_option "$options" port 8889)
|
9
|
-
|
10
|
-
local model_object_name=$(abcli_clarify_object $2 .)
|
11
|
-
[[ "$do_download" == 1 ]] &&
|
12
|
-
abcli_download - $model_object_name
|
13
|
-
|
14
|
-
[[ "$do_browse" == 1 ]] &&
|
15
|
-
abcli_browse http://localhost:$port/
|
16
|
-
|
17
|
-
abcli_eval ,$options \
|
18
|
-
tensorboard \
|
19
|
-
--logdir $ABCLI_OBJECT_ROOT/$model_object_name/logs/ \
|
20
|
-
--port $port
|
21
|
-
}
|
@@ -1,53 +0,0 @@
|
|
1
|
-
#! /usr/bin/env bash
|
2
|
-
|
3
|
-
function blue_sandbox_microsoft_building_damage_assessment_train() {
|
4
|
-
local options=$1
|
5
|
-
local do_dryrun=$(abcli_option_int "$options" dryrun 0)
|
6
|
-
local do_download=$(abcli_option_int "$options" download $(abcli_not $do_dryrun))
|
7
|
-
local do_upload=$(abcli_option_int "$options" upload $(abcli_not $do_dryrun))
|
8
|
-
|
9
|
-
local dataset_object_name=$(abcli_clarify_object $2 .)
|
10
|
-
[[ "$do_download" == 1 ]] &&
|
11
|
-
abcli_download - $dataset_object_name
|
12
|
-
|
13
|
-
local model_object_name=$(abcli_clarify_object $3 $dataset_object_name-model-$(abcli_string_timestamp_short))
|
14
|
-
|
15
|
-
abcli_log "training $dataset_object_name -> $model_object_name ..."
|
16
|
-
|
17
|
-
conda activate bda
|
18
|
-
[[ $? -ne 0 ]] && return 1
|
19
|
-
|
20
|
-
abcli_eval dryrun=$do_dryrun \
|
21
|
-
python3 -m blue_sandbox.microsoft_building_damage_assessment \
|
22
|
-
train \
|
23
|
-
--dataset_object_name $dataset_object_name \
|
24
|
-
--model_object_name $model_object_name \
|
25
|
-
"${@:4}"
|
26
|
-
[[ $? -ne 0 ]] && return 1
|
27
|
-
|
28
|
-
abcli_eval dryrun=$do_dryrun,path=$abcli_path_git/building-damage-assessment \
|
29
|
-
python3 project_setup.py \
|
30
|
-
--skip_health_check \
|
31
|
-
--config $ABCLI_OBJECT_ROOT/$model_object_name/config.yml
|
32
|
-
[[ $? -ne 0 ]] && return 1
|
33
|
-
|
34
|
-
abcli_eval dryrun=$do_dryrun,path=$abcli_path_git/building-damage-assessment \
|
35
|
-
python3 create_masks.py \
|
36
|
-
--config $ABCLI_OBJECT_ROOT/$model_object_name/config.yml
|
37
|
-
[[ $? -ne 0 ]] && return 1
|
38
|
-
|
39
|
-
abcli_eval dryrun=$do_dryrun,path=$abcli_path_git/building-damage-assessment \
|
40
|
-
python3 fine_tune.py \
|
41
|
-
--config $ABCLI_OBJECT_ROOT/$model_object_name/config.yml
|
42
|
-
[[ $? -ne 0 ]] && return 1
|
43
|
-
|
44
|
-
abcli_eval dryrun=$do_dryrun,path=$abcli_path_git/building-damage-assessment \
|
45
|
-
python3 inference.py \
|
46
|
-
--config $ABCLI_OBJECT_ROOT/$model_object_name/config.yml
|
47
|
-
[[ $? -ne 0 ]] && return 1
|
48
|
-
|
49
|
-
[[ "$do_upload" == 1 ]] &&
|
50
|
-
abcli_upload - $model_object_name
|
51
|
-
|
52
|
-
return 0
|
53
|
-
}
|