blue-sandbox 5.47.1__tar.gz → 5.87.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. {blue_sandbox-5.47.1/blue_sandbox.egg-info → blue_sandbox-5.87.1}/PKG-INFO +11 -4
  2. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/README.md +2 -2
  3. blue_sandbox-5.87.1/blue_sandbox/.abcli/alias.sh +5 -0
  4. blue_sandbox-5.87.1/blue_sandbox/.abcli/install.sh +7 -0
  5. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest.sh +2 -4
  6. blue_sandbox-5.87.1/blue_sandbox/.abcli/microsoft_building_damage_assessment/install.sh +49 -0
  7. blue_sandbox-5.87.1/blue_sandbox/.abcli/microsoft_building_damage_assessment/label.sh +26 -0
  8. blue_sandbox-5.87.1/blue_sandbox/.abcli/microsoft_building_damage_assessment/tensorboard.sh +21 -0
  9. blue_sandbox-5.87.1/blue_sandbox/.abcli/microsoft_building_damage_assessment/train.sh +53 -0
  10. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/tests/help.sh +7 -3
  11. blue_sandbox-5.87.1/blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_label.sh +12 -0
  12. blue_sandbox-5.87.1/blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_train.sh +20 -0
  13. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/README.py +1 -1
  14. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/__init__.py +1 -1
  15. blue_sandbox-5.87.1/blue_sandbox/config.env +1 -0
  16. blue_sandbox-5.87.1/blue_sandbox/env.py +13 -0
  17. blue_sandbox-5.87.1/blue_sandbox/microsoft_building_damage_assessment/README.py +45 -0
  18. blue_sandbox-5.87.1/blue_sandbox/microsoft_building_damage_assessment/__main__.py +82 -0
  19. blue_sandbox-5.87.1/blue_sandbox/microsoft_building_damage_assessment/ingest.py +31 -0
  20. blue_sandbox-5.87.1/blue_sandbox/microsoft_building_damage_assessment/label.py +38 -0
  21. blue_sandbox-5.87.1/blue_sandbox/microsoft_building_damage_assessment/sas_token.py +9 -0
  22. blue_sandbox-5.87.1/blue_sandbox/microsoft_building_damage_assessment/train.py +95 -0
  23. blue_sandbox-5.87.1/blue_sandbox/sample.env +1 -0
  24. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1/blue_sandbox.egg-info}/PKG-INFO +11 -4
  25. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox.egg-info/SOURCES.txt +10 -1
  26. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox.egg-info/requires.txt +8 -1
  27. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/requirements.txt +10 -1
  28. blue_sandbox-5.47.1/blue_sandbox/.abcli/alias.sh +0 -5
  29. blue_sandbox-5.47.1/blue_sandbox/.abcli/install.sh +0 -12
  30. blue_sandbox-5.47.1/blue_sandbox/config.env +0 -1
  31. blue_sandbox-5.47.1/blue_sandbox/env.py +0 -11
  32. blue_sandbox-5.47.1/blue_sandbox/microsoft_building_damage_assessment/README.py +0 -34
  33. blue_sandbox-5.47.1/blue_sandbox/microsoft_building_damage_assessment/__main__.py +0 -47
  34. blue_sandbox-5.47.1/blue_sandbox/microsoft_building_damage_assessment/ingest.py +0 -19
  35. blue_sandbox-5.47.1/blue_sandbox/sample.env +0 -0
  36. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/LICENSE +0 -0
  37. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/MANIFEST.in +0 -0
  38. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/abcli.sh +0 -0
  39. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/actions.sh +0 -0
  40. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/aka.sh +0 -0
  41. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/blue_sandbox.sh +0 -0
  42. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/browse.sh +0 -0
  43. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest/list.sh +0 -0
  44. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/microsoft_building_damage_assessment.sh +0 -0
  45. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/tests/README.sh +0 -0
  46. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest.sh +0 -0
  47. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest_list.sh +0 -0
  48. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/.abcli/tests/version.sh +0 -0
  49. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/__main__.py +0 -0
  50. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/functions.py +0 -0
  51. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/help/__init__.py +0 -0
  52. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/help/__main__.py +0 -0
  53. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/help/functions.py +0 -0
  54. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/host.py +0 -0
  55. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/logger.py +0 -0
  56. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/microsoft_building_damage_assessment/__init__.py +0 -0
  57. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox/urls.py +0 -0
  58. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox.egg-info/dependency_links.txt +0 -0
  59. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/blue_sandbox.egg-info/top_level.txt +0 -0
  60. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/pyproject.toml +0 -0
  61. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/setup.cfg +0 -0
  62. {blue_sandbox-5.47.1 → blue_sandbox-5.87.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_sandbox
3
- Version: 5.47.1
3
+ Version: 5.87.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)
@@ -13,8 +13,12 @@ Classifier: Operating System :: OS Independent
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: blueness
16
- Requires-Dist: blue-options
17
16
  Requires-Dist: abcli
17
+ Requires-Dist: blue-options
18
+ Requires-Dist: blue_objects
19
+ Requires-Dist: blue_geo
20
+ Requires-Dist: blueflow
21
+ Requires-Dist: blue_plugin
18
22
  Requires-Dist: boto3
19
23
  Requires-Dist: geojson
20
24
  Requires-Dist: geopandas
@@ -27,6 +31,9 @@ Requires-Dist: pylint
27
31
  Requires-Dist: pytest
28
32
  Requires-Dist: python-dotenv[cli]
29
33
  Requires-Dist: tqdm
34
+ Requires-Dist: azure-storage-blob
35
+ Requires-Dist: fiona
36
+ Requires-Dist: tensorboard
30
37
  Dynamic: author
31
38
  Dynamic: author-email
32
39
  Dynamic: classifier
@@ -47,11 +54,11 @@ pip install blue-sandbox
47
54
 
48
55
  | | | |
49
56
  | --- | --- | --- |
50
- | 🌐[``@damage``](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) [![image](https://github.com/microsoft/building-damage-assessment/raw/main/figures/damage.png)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) Satellite imagery damage assessment workflow | 🌀[`experiment 2`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 2 ... | 🌀[`experiment 3`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 3 ... |
57
+ | 🌐[``@damages``](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) [![image](https://github.com/microsoft/building-damage-assessment/raw/main/figures/damage.png)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) Satellite imagery damage assessment workflow | 🌀[`experiment 2`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 2 ... | 🌀[`experiment 3`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 3 ... |
51
58
 
52
59
  ---
53
60
 
54
61
 
55
62
  [![pylint](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-sandbox.svg)](https://pypi.org/project/blue-sandbox/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-sandbox)](https://pypistats.org/packages/blue-sandbox)
56
63
 
57
- built by 🌀 [`blue_options-4.177.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.47.1`](https://github.com/kamangir/blue-sandbox).
64
+ built by 🌀 [`blue_options-4.180.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.87.1`](https://github.com/kamangir/blue-sandbox).
@@ -8,11 +8,11 @@ pip install blue-sandbox
8
8
 
9
9
  | | | |
10
10
  | --- | --- | --- |
11
- | 🌐[``@damage``](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) [![image](https://github.com/microsoft/building-damage-assessment/raw/main/figures/damage.png)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) Satellite imagery damage assessment workflow | 🌀[`experiment 2`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 2 ... | 🌀[`experiment 3`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 3 ... |
11
+ | 🌐[``@damages``](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) [![image](https://github.com/microsoft/building-damage-assessment/raw/main/figures/damage.png)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) Satellite imagery damage assessment workflow | 🌀[`experiment 2`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 2 ... | 🌀[`experiment 3`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 3 ... |
12
12
 
13
13
  ---
14
14
 
15
15
 
16
16
  [![pylint](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-sandbox.svg)](https://pypi.org/project/blue-sandbox/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-sandbox)](https://pypistats.org/packages/blue-sandbox)
17
17
 
18
- built by 🌀 [`blue_options-4.177.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.47.1`](https://github.com/kamangir/blue-sandbox).
18
+ built by 🌀 [`blue_options-4.180.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.87.1`](https://github.com/kamangir/blue-sandbox).
@@ -0,0 +1,5 @@
1
+ #! /usr/bin/env bash
2
+
3
+ alias @damages="blue_sandbox_microsoft_building_damage_assessment"
4
+
5
+ alias @sandbox=blue_sandbox
@@ -0,0 +1,7 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_install_blue_sandbox() {
4
+ abcli_log "✅"
5
+ }
6
+
7
+ abcli_install_module blue_sandbox 1.1.1
@@ -26,8 +26,8 @@ function blue_sandbox_microsoft_building_damage_assessment_ingest() {
26
26
  pushd $object_path >/dev/null
27
27
 
28
28
  # https://github.com/microsoft/building-damage-assessment/blob/main/SATELLITE_WORKFLOW.md#1-image-acquisition-and-label-generation
29
- mkdir -pv data/demo/raw/
30
- cd data/demo/raw/
29
+ mkdir -pv raw
30
+ cd raw
31
31
 
32
32
  if [[ "$do_download" == 1 ]]; then
33
33
  # TODO: use $event_name and $count (options +=)
@@ -57,8 +57,6 @@ function blue_sandbox_microsoft_building_damage_assessment_ingest() {
57
57
  rm -v maxar_lahaina_8_12_2023-visual.vrt
58
58
  fi
59
59
 
60
- cd ../../..
61
-
62
60
  popd >/dev/null
63
61
 
64
62
  abcli_eval dryrun=$do_dryrun \
@@ -0,0 +1,49 @@
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
+ return 0
17
+
18
+ if [[ "$recreate_env" == 1 ]]; then
19
+ abcli_conda_rm name=bda
20
+ [[ $? -ne 0 ]] && return 1
21
+ fi
22
+
23
+ local exists=$(abcli_conda_exists name=bda)
24
+ if [[ "$exists" == 0 ]]; then
25
+ # https://github.com/microsoft/building-damage-assessment?tab=readme-ov-file#setup
26
+ conda env create \
27
+ -f $abcli_path_git/building-damage-assessment/environment.yml
28
+ [[ $? -ne 0 ]] && return 1
29
+ fi
30
+
31
+ conda activate bda
32
+ [[ $? -ne 0 ]] && return 1
33
+
34
+ pushd $abcli_path_git/blue-sandbox >/dev/null
35
+ pip3 install -e .
36
+ [[ $? -ne 0 ]] && return 1
37
+ popd >/dev/null
38
+
39
+ [[ "$abcli_is_mac" == true ]] &&
40
+ brew install wget
41
+
42
+ return 0
43
+ }
44
+
45
+ function abcli_install_microsoft_building_damage_assessment() {
46
+ blue_sandbox_microsoft_building_damage_assessment_install "$@"
47
+ }
48
+
49
+ abcli_install_module microsoft_building_damage_assessment 1.1.1
@@ -0,0 +1,26 @@
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
+ }
@@ -0,0 +1,21 @@
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
+ }
@@ -0,0 +1,53 @@
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
+ }
@@ -7,9 +7,13 @@ function test_blue_sandbox_help() {
7
7
  for module in \
8
8
  "@sandbox" \
9
9
  \
10
- "@damage" \
11
- "@damage ingest" \
12
- "@damage ingest list" \
10
+ "@damages" \
11
+ "@damages ingest" \
12
+ "@damages ingest list" \
13
+ "@damages install" \
14
+ "@damages label" \
15
+ "@damages tensorboard" \
16
+ "@damages train" \
13
17
  \
14
18
  "blue_sandbox"; do
15
19
  abcli_eval ,$options \
@@ -0,0 +1,12 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_blue_sandbox_microsoft_building_damage_assessment_label() {
4
+ local options=$1
5
+
6
+ abcli_eval ,$options \
7
+ blue_sandbox_microsoft_building_damage_assessment \
8
+ label \
9
+ ~upload,$options \
10
+ $DAMAGES_TEST_DATASET_OBJECT_NAME \
11
+ "${@:2}"
12
+ }
@@ -0,0 +1,20 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_blue_sandbox_microsoft_building_damage_assessment_train() {
4
+ local options=$1
5
+
6
+ abcli_log_warning "disabled."
7
+ return 0
8
+
9
+ abcli_eval ,$options \
10
+ blue_sandbox_microsoft_building_damage_assessment \
11
+ train \
12
+ ~upload,$options \
13
+ $DAMAGES_TEST_DATASET_OBJECT_NAME \
14
+ test_blue_sandbox_microsoft_building_damage_assessment_train-$(abcli_string_timestamp_short) \
15
+ --verbose 1 \
16
+ "${@:2}"
17
+
18
+ # ignore error - TODO: disable
19
+ return 0
20
+ }
@@ -11,7 +11,7 @@ from blue_sandbox.microsoft_building_damage_assessment import (
11
11
  items = [
12
12
  "{}[`{}`]({}) [![image]({})]({}) {}".format(
13
13
  "🌐",
14
- "`@damage`",
14
+ "`@damages`",
15
15
  "https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md",
16
16
  "https://github.com/microsoft/building-damage-assessment/raw/main/figures/damage.png",
17
17
  "https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md",
@@ -4,7 +4,7 @@ ICON = "🌀"
4
4
 
5
5
  DESCRIPTION = f"{ICON} A sandbox for ideas and experiments."
6
6
 
7
- VERSION = "5.47.1"
7
+ VERSION = "5.87.1"
8
8
 
9
9
  REPO_NAME = "blue-sandbox"
10
10
 
@@ -0,0 +1 @@
1
+ DAMAGES_TEST_DATASET_OBJECT_NAME=Maui-Hawaii-fires-Aug-23-ingest-2025-01-10-qqJqhm
@@ -0,0 +1,13 @@
1
+ import os
2
+ from blue_options.env import load_config, load_env
3
+
4
+ load_env(__name__)
5
+ load_config(__name__)
6
+
7
+
8
+ DAMAGES_TEST_DATASET_OBJECT_NAME = os.getenv(
9
+ "DAMAGES_TEST_DATASET_OBJECT_NAME",
10
+ "",
11
+ )
12
+
13
+ ENCODED_BLOB_SAS_TOKEN = os.getenv("ENCODED_BLOB_SAS_TOKEN", "")
@@ -0,0 +1,45 @@
1
+ from typing import Dict
2
+
3
+ from blue_sandbox.env import DAMAGES_TEST_DATASET_OBJECT_NAME
4
+
5
+ list_of_steps: Dict[str, Dict] = {
6
+ "ingest": {
7
+ "object_name": DAMAGES_TEST_DATASET_OBJECT_NAME,
8
+ "image_name": "Maui-Hawaii-fires-Aug-23-damage-2025-01-09-GgnjQC",
9
+ },
10
+ "label": {
11
+ "object_name": "",
12
+ "image_name": DAMAGES_TEST_DATASET_OBJECT_NAME,
13
+ },
14
+ "train": {
15
+ "object_name": "",
16
+ "image_name": "Maui-Hawaii-fires-Aug-23-model-2025-01-10-NQb8IS",
17
+ },
18
+ "predict": {"object_name": "", "image_name": ""},
19
+ "summarize": {"object_name": "", "image_name": ""},
20
+ }
21
+
22
+ items = (
23
+ [f"`{step}`" for step in list_of_steps]
24
+ + [
25
+ (
26
+ "[`{}`](https://kamangir-public.s3.ca-central-1.amazonaws.com/{}.tar.gz)".format(
27
+ step["object_name"],
28
+ step["image_name"],
29
+ )
30
+ if step["object_name"]
31
+ else ""
32
+ )
33
+ for step in list_of_steps.values()
34
+ ]
35
+ + [
36
+ (
37
+ "![image](https://github.com/kamangir/assets/blob/main/blue-sandbox/{}.png?raw=true)".format(
38
+ step["image_name"],
39
+ )
40
+ if step["image_name"]
41
+ else ""
42
+ )
43
+ for step in list_of_steps.values()
44
+ ]
45
+ )
@@ -0,0 +1,82 @@
1
+ import argparse
2
+
3
+ from blueness import module
4
+ from blueness.argparse.generic import sys_exit
5
+
6
+ from blue_sandbox import NAME
7
+ from blue_sandbox.microsoft_building_damage_assessment.ingest import ingest
8
+ from blue_sandbox.microsoft_building_damage_assessment.label import label
9
+ from blue_sandbox.microsoft_building_damage_assessment.train import train
10
+ from blue_sandbox.microsoft_building_damage_assessment.sas_token import (
11
+ decode_token,
12
+ encode_token,
13
+ )
14
+ from blue_sandbox.help.microsoft_building_damage_assessment import list_of_events
15
+ from blue_sandbox.logger import logger
16
+
17
+ NAME = module.name(__file__, NAME)
18
+
19
+ parser = argparse.ArgumentParser(NAME)
20
+ parser.add_argument(
21
+ "task",
22
+ type=str,
23
+ help="decode_token | encode_token | ingest | label | train",
24
+ )
25
+ parser.add_argument(
26
+ "--object_name",
27
+ type=str,
28
+ )
29
+ parser.add_argument(
30
+ "--dataset_object_name",
31
+ type=str,
32
+ )
33
+ parser.add_argument(
34
+ "--model_object_name",
35
+ type=str,
36
+ )
37
+ parser.add_argument(
38
+ "--event_name",
39
+ type=str,
40
+ default=list_of_events[0],
41
+ help=" | ".join(list_of_events),
42
+ )
43
+ parser.add_argument(
44
+ "--verbose",
45
+ type=bool,
46
+ default=0,
47
+ help="0|1",
48
+ )
49
+ parser.add_argument(
50
+ "--token",
51
+ type=str,
52
+ )
53
+ args = parser.parse_args()
54
+
55
+ success = False
56
+ if args.task == "decode_token":
57
+ success = True
58
+ print(decode_token(args.token))
59
+ elif args.task == "encode_token":
60
+ success = True
61
+ print(encode_token(args.token))
62
+ elif args.task == "ingest":
63
+ success = ingest(
64
+ object_name=args.object_name,
65
+ event_name=args.event_name,
66
+ verbose=args.verbose == 1,
67
+ )
68
+ elif args.task == "label":
69
+ success = label(
70
+ object_name=args.object_name,
71
+ verbose=args.verbose == 1,
72
+ )
73
+ elif args.task == "train":
74
+ success = train(
75
+ dataset_object_name=args.dataset_object_name,
76
+ model_object_name=args.model_object_name,
77
+ verbose=args.verbose == 1,
78
+ )
79
+ else:
80
+ success = None
81
+
82
+ sys_exit(logger, NAME, args.task, success)
@@ -0,0 +1,31 @@
1
+ from blueness import module
2
+
3
+ from blue_objects import mlflow, metadata
4
+
5
+ from blue_sandbox import NAME
6
+ from blue_sandbox.logger import logger
7
+
8
+
9
+ NAME = module.name(__file__, NAME)
10
+
11
+
12
+ def ingest(
13
+ event_name: str,
14
+ object_name: str,
15
+ verbose: bool = False,
16
+ ) -> bool:
17
+ logger.info(f"{NAME}.ingest({event_name}) -> {object_name}")
18
+
19
+ return all(
20
+ [
21
+ mlflow.set_tags(
22
+ object_name,
23
+ {"event": event_name},
24
+ ),
25
+ metadata.post_to_object(
26
+ object_name,
27
+ "ingest",
28
+ {"event": event_name},
29
+ ),
30
+ ]
31
+ )
@@ -0,0 +1,38 @@
1
+ import os
2
+
3
+ from blueness import module
4
+ from blue_objects import metadata, file, objects
5
+ from blue_objects.env import abcli_path_git
6
+
7
+ from blue_sandbox import NAME
8
+ from blue_sandbox.logger import logger
9
+
10
+
11
+ NAME = module.name(__file__, NAME)
12
+
13
+
14
+ def label(
15
+ object_name: str,
16
+ verbose: bool = False,
17
+ ) -> bool:
18
+ logger.info(f"{NAME}.label: {object_name}")
19
+
20
+ geojson_filename = os.path.join(
21
+ abcli_path_git,
22
+ "building-damage-assessment/data/demo/labels/Maui_Wildfires_August_0.geojson",
23
+ )
24
+
25
+ if not file.copy(
26
+ geojson_filename,
27
+ objects.path_of(
28
+ filename="label.geojson",
29
+ object_name=object_name,
30
+ ),
31
+ ):
32
+ return False
33
+
34
+ return metadata.post_to_object(
35
+ object_name,
36
+ "label",
37
+ {"geojson": geojson_filename},
38
+ )
@@ -0,0 +1,9 @@
1
+ import base64
2
+
3
+
4
+ def encode_token(token: str) -> str:
5
+ return base64.b64encode(token.encode()).decode()
6
+
7
+
8
+ def decode_token(encoded_token: str) -> str:
9
+ return base64.b64decode(encoded_token.encode()).decode()
@@ -0,0 +1,95 @@
1
+ import os
2
+
3
+ from blueness import module
4
+ from blue_objects import mlflow, metadata, file, objects, path
5
+ from blue_objects.env import abcli_path_git
6
+
7
+ from blue_sandbox import NAME
8
+ from blue_sandbox.env import ENCODED_BLOB_SAS_TOKEN
9
+ from blue_sandbox.microsoft_building_damage_assessment.sas_token import decode_token
10
+ from blue_sandbox.logger import logger
11
+
12
+
13
+ NAME = module.name(__file__, NAME)
14
+
15
+
16
+ # ... copy `configs/example_config.yml` and fill the first three sections.
17
+ def train(
18
+ dataset_object_name: str,
19
+ model_object_name: str,
20
+ verbose: bool = False,
21
+ ) -> bool:
22
+ logger.info(f"{NAME}.train: {dataset_object_name} -> {model_object_name}")
23
+
24
+ config_filename = os.path.join(
25
+ abcli_path_git,
26
+ "building-damage-assessment/configs/example_config.yml",
27
+ )
28
+ success, config = file.load_yaml(config_filename)
29
+ if not success:
30
+ return False
31
+
32
+ config["experiment_dir"] = objects.object_path(model_object_name)
33
+ config["experiment_name"] = model_object_name
34
+
35
+ config["imagery"]["rgb_fn"] = config["imagery"]["raw_fn"] = objects.path_of(
36
+ filename="raw/maxar_lahaina_8_12_2023-visual.tif",
37
+ object_name=dataset_object_name,
38
+ )
39
+
40
+ config["inference"]["output_subdir"] = objects.path_of(
41
+ filename="outputs/",
42
+ object_name=model_object_name,
43
+ )
44
+ config["inference"]["checkpoint_fn"] = objects.path_of(
45
+ filename="checkpoints/last.ckpt",
46
+ object_name=model_object_name,
47
+ )
48
+
49
+ config["infrastructure"]["container_name"] = "sandbox"
50
+ config["infrastructure"][
51
+ "storage_account"
52
+ ] = "https://kamangir.blob.core.windows.net/"
53
+ config["infrastructure"]["sas_token"] = decode_token(ENCODED_BLOB_SAS_TOKEN)
54
+ config["infrastructure"]["relative_path"] = dataset_object_name
55
+
56
+ config["labels"]["fn"] = objects.path_of(
57
+ filename="label.geojson",
58
+ object_name=dataset_object_name,
59
+ )
60
+
61
+ config["training"]["log_dir"] = objects.path_of(
62
+ filename="logs/",
63
+ object_name=model_object_name,
64
+ )
65
+ config["training"]["checkpoint_subdir"] = objects.path_of(
66
+ filename="checkpoints/",
67
+ object_name=model_object_name,
68
+ )
69
+
70
+ if not file.save_yaml(
71
+ objects.path_of(
72
+ filename="config.yml",
73
+ object_name=model_object_name,
74
+ ),
75
+ config,
76
+ ):
77
+ return False
78
+
79
+ return all(
80
+ [
81
+ mlflow.set_tags(
82
+ model_object_name,
83
+ {
84
+ "dataset": dataset_object_name,
85
+ },
86
+ ),
87
+ metadata.post_to_object(
88
+ model_object_name,
89
+ "train",
90
+ {
91
+ "dataset": dataset_object_name,
92
+ },
93
+ ),
94
+ ]
95
+ )
@@ -0,0 +1 @@
1
+ ENCODED_BLOB_SAS_TOKEN=value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_sandbox
3
- Version: 5.47.1
3
+ Version: 5.87.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)
@@ -13,8 +13,12 @@ Classifier: Operating System :: OS Independent
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: blueness
16
- Requires-Dist: blue-options
17
16
  Requires-Dist: abcli
17
+ Requires-Dist: blue-options
18
+ Requires-Dist: blue_objects
19
+ Requires-Dist: blue_geo
20
+ Requires-Dist: blueflow
21
+ Requires-Dist: blue_plugin
18
22
  Requires-Dist: boto3
19
23
  Requires-Dist: geojson
20
24
  Requires-Dist: geopandas
@@ -27,6 +31,9 @@ Requires-Dist: pylint
27
31
  Requires-Dist: pytest
28
32
  Requires-Dist: python-dotenv[cli]
29
33
  Requires-Dist: tqdm
34
+ Requires-Dist: azure-storage-blob
35
+ Requires-Dist: fiona
36
+ Requires-Dist: tensorboard
30
37
  Dynamic: author
31
38
  Dynamic: author-email
32
39
  Dynamic: classifier
@@ -47,11 +54,11 @@ pip install blue-sandbox
47
54
 
48
55
  | | | |
49
56
  | --- | --- | --- |
50
- | 🌐[``@damage``](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) [![image](https://github.com/microsoft/building-damage-assessment/raw/main/figures/damage.png)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) Satellite imagery damage assessment workflow | 🌀[`experiment 2`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 2 ... | 🌀[`experiment 3`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 3 ... |
57
+ | 🌐[``@damages``](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) [![image](https://github.com/microsoft/building-damage-assessment/raw/main/figures/damage.png)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) Satellite imagery damage assessment workflow | 🌀[`experiment 2`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 2 ... | 🌀[`experiment 3`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 3 ... |
51
58
 
52
59
  ---
53
60
 
54
61
 
55
62
  [![pylint](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-sandbox.svg)](https://pypi.org/project/blue-sandbox/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-sandbox)](https://pypistats.org/packages/blue-sandbox)
56
63
 
57
- built by 🌀 [`blue_options-4.177.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.47.1`](https://github.com/kamangir/blue-sandbox).
64
+ built by 🌀 [`blue_options-4.180.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.87.1`](https://github.com/kamangir/blue-sandbox).
@@ -28,11 +28,17 @@ blue_sandbox/.abcli/browse.sh
28
28
  blue_sandbox/.abcli/install.sh
29
29
  blue_sandbox/.abcli/microsoft_building_damage_assessment.sh
30
30
  blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest.sh
31
+ blue_sandbox/.abcli/microsoft_building_damage_assessment/install.sh
32
+ blue_sandbox/.abcli/microsoft_building_damage_assessment/label.sh
33
+ blue_sandbox/.abcli/microsoft_building_damage_assessment/tensorboard.sh
34
+ blue_sandbox/.abcli/microsoft_building_damage_assessment/train.sh
31
35
  blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest/list.sh
32
36
  blue_sandbox/.abcli/tests/README.sh
33
37
  blue_sandbox/.abcli/tests/help.sh
34
38
  blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest.sh
35
39
  blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest_list.sh
40
+ blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_label.sh
41
+ blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_train.sh
36
42
  blue_sandbox/.abcli/tests/version.sh
37
43
  blue_sandbox/help/__init__.py
38
44
  blue_sandbox/help/__main__.py
@@ -40,4 +46,7 @@ blue_sandbox/help/functions.py
40
46
  blue_sandbox/microsoft_building_damage_assessment/README.py
41
47
  blue_sandbox/microsoft_building_damage_assessment/__init__.py
42
48
  blue_sandbox/microsoft_building_damage_assessment/__main__.py
43
- blue_sandbox/microsoft_building_damage_assessment/ingest.py
49
+ blue_sandbox/microsoft_building_damage_assessment/ingest.py
50
+ blue_sandbox/microsoft_building_damage_assessment/label.py
51
+ blue_sandbox/microsoft_building_damage_assessment/sas_token.py
52
+ blue_sandbox/microsoft_building_damage_assessment/train.py
@@ -1,6 +1,10 @@
1
1
  blueness
2
- blue-options
3
2
  abcli
3
+ blue-options
4
+ blue_objects
5
+ blue_geo
6
+ blueflow
7
+ blue_plugin
4
8
  boto3
5
9
  geojson
6
10
  geopandas
@@ -13,3 +17,6 @@ pylint
13
17
  pytest
14
18
  python-dotenv[cli]
15
19
  tqdm
20
+ azure-storage-blob
21
+ fiona
22
+ tensorboard
@@ -1,6 +1,11 @@
1
1
  blueness
2
- blue-options
3
2
  abcli
3
+ blue-options
4
+ blue_objects
5
+ blue_geo
6
+ blueflow
7
+ blue_plugin
8
+
4
9
  boto3
5
10
  geojson
6
11
  geopandas
@@ -13,3 +18,7 @@ pylint
13
18
  pytest
14
19
  python-dotenv[cli]
15
20
  tqdm
21
+
22
+ azure-storage-blob
23
+ fiona
24
+ tensorboard
@@ -1,5 +0,0 @@
1
- #! /usr/bin/env bash
2
-
3
- alias @damage="blue_sandbox_microsoft_building_damage_assessment"
4
-
5
- alias @sandbox=blue_sandbox
@@ -1,12 +0,0 @@
1
- #! /usr/bin/env bash
2
-
3
- function abcli_install_blue_sandbox() {
4
- abcli_git_clone https://github.com/microsoft/building-damage-assessment.git
5
-
6
- [[ "$abcli_is_mac" == true ]] &&
7
- brew install wget
8
-
9
- return 0
10
- }
11
-
12
- abcli_install_module blue_sandbox 1.1.1
@@ -1 +0,0 @@
1
- BLUE_PLUGIN_CONFIG=value
@@ -1,11 +0,0 @@
1
- import os
2
- from blue_options.env import load_config, load_env
3
-
4
- load_env(__name__)
5
- load_config(__name__)
6
-
7
-
8
- BLUE_PLUGIN_CONFIG = os.getenv(
9
- "BLUE_PLUGIN_CONFIG",
10
- "",
11
- )
@@ -1,34 +0,0 @@
1
- from typing import Dict
2
-
3
- list_of_steps: Dict[str, Dict] = {
4
- "ingest": "Maui-Hawaii-fires-Aug-23-damage-2025-01-09-GgnjQC",
5
- "label": "",
6
- "train": "",
7
- "predict": "",
8
- "summarize": "",
9
- }
10
-
11
- items = (
12
- [f"`{step}`" for step in list_of_steps]
13
- + [
14
- (
15
- "[`{}`](https://kamangir-public.s3.ca-central-1.amazonaws.com/{}.tar.gz)".format(
16
- object_name,
17
- object_name,
18
- )
19
- if object_name
20
- else ""
21
- )
22
- for object_name in list_of_steps.values()
23
- ]
24
- + [
25
- (
26
- "[![image](https://github.com/kamangir/assets/blob/main/blue-sandbox/{}.png?raw=true)](#)".format(
27
- object_name,
28
- )
29
- if object_name
30
- else ""
31
- )
32
- for object_name in list_of_steps.values()
33
- ]
34
- )
@@ -1,47 +0,0 @@
1
- import argparse
2
-
3
- from blueness import module
4
- from blueness.argparse.generic import sys_exit
5
-
6
- from blue_sandbox import NAME
7
- from blue_sandbox.microsoft_building_damage_assessment.ingest import ingest
8
- from blue_sandbox.help.microsoft_building_damage_assessment import list_of_events
9
- from blue_sandbox.logger import logger
10
-
11
- NAME = module.name(__file__, NAME)
12
-
13
- parser = argparse.ArgumentParser(NAME)
14
- parser.add_argument(
15
- "task",
16
- type=str,
17
- help="ingest",
18
- )
19
- parser.add_argument(
20
- "--object_name",
21
- type=str,
22
- )
23
- parser.add_argument(
24
- "--event_name",
25
- type=str,
26
- default=list_of_events[0],
27
- help=" | ".join(list_of_events),
28
- )
29
- parser.add_argument(
30
- "--verbose",
31
- type=bool,
32
- default=0,
33
- help="0|1",
34
- )
35
- args = parser.parse_args()
36
-
37
- success = False
38
- if args.task == "ingest":
39
- success = ingest(
40
- object_name=args.object_name,
41
- event_name=args.event_name,
42
- verbose=args.verbose == 1,
43
- )
44
- else:
45
- success = None
46
-
47
- sys_exit(logger, NAME, args.task, success)
@@ -1,19 +0,0 @@
1
- from blueness import module
2
-
3
- from blue_sandbox import NAME
4
- from blue_sandbox.logger import logger
5
-
6
-
7
- NAME = module.name(__file__, NAME)
8
-
9
-
10
- def ingest(
11
- event_name: str,
12
- object_name: str,
13
- verbose: bool = False,
14
- ) -> bool:
15
- logger.info(f"{NAME}.ingest({event_name}) -> {object_name}")
16
-
17
- logger.info("🪄")
18
-
19
- return True
File without changes
File without changes
File without changes
File without changes
File without changes