blue-sandbox 5.235.1__py3-none-any.whl → 5.267.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.
@@ -0,0 +1,35 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function blue_sandbox_palisades_predict() {
4
+ local options=$1
5
+ $abcli_gpu_status_cache && local device=cuda || local device=cpu
6
+ local device=$(abcli_option "$options" device $device)
7
+ local do_dryrun=$(abcli_option_int "$options" dryrun 0)
8
+ local do_download=$(abcli_option_int "$options" download $(abcli_not $do_dryrun))
9
+ local do_upload=$(abcli_option_int "$options" upload $(abcli_not $do_dryrun))
10
+
11
+ local model_object_name=$(abcli_clarify_object $2 ..)
12
+ [[ "$do_download" == 1 ]] &&
13
+ abcli_download - $model_object_name
14
+
15
+ local datacube_id=$(abcli_clarify_object $3 .)
16
+
17
+ local prediction_object_name=$(abcli_clarify_object $4 predict-$datacube_id-$(abcli_string_timestamp_short))
18
+
19
+ abcli_log "semseg[$model_object_name].predict($datacube_id) -$device-> $prediction_object_name."
20
+
21
+ abcli_eval dryrun=$do_dryrun \
22
+ python3 -m blue_sandbox.palisades predict \
23
+ --device $device \
24
+ --model_object_name $model_object_name \
25
+ --datacube_id $datacube_id \
26
+ --prediction_object_name $prediction_object_name \
27
+ --profile $(abcli_option "$options" profile VALIDATION) \
28
+ "${@:5}"
29
+ local status="$?"
30
+
31
+ [[ "$do_upload" == 1 ]] &&
32
+ abcli_upload - $prediction_object_name
33
+
34
+ return $status
35
+ }
@@ -0,0 +1,58 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function blue_sandbox_palisades_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_review=$(abcli_option_int "$options" review 0)
8
+
9
+ local query_object_name=$(abcli_clarify_object $2 .)
10
+ [[ "$do_download" == 1 ]] &&
11
+ abcli_download - $query_object_name
12
+
13
+ local ingest_options=$3
14
+ local count=$(abcli_option "$ingest_options" count 10000)
15
+
16
+ local dataset_object_name=$(abcli_clarify_object $4 ${query_object_name}-ingest-$(abcli_string_timestamp_short))
17
+
18
+ local train_options=$5
19
+ local epoch_count=$(abcli_option "$train_options" epochs 5)
20
+
21
+ local model_object_name=$(abcli_clarify_object $6 ${dataset_object_name}-model-$(abcli_string_timestamp_short))
22
+
23
+ if [[ "$do_review" == 1 ]]; then
24
+ roofai_dataset_review \
25
+ dryrun=$do_dryrun \
26
+ $query_object_name \
27
+ --index 0 \
28
+ --subset test
29
+ [[ $? -ne 0 ]] && return 1
30
+ fi
31
+
32
+ roofai_dataset_ingest \
33
+ ~download,source=$query_object_name,$ingest_options \
34
+ $dataset_object_name \
35
+ --test_count $(python3 -c "print(int($count*0.1))") \
36
+ --train_count $(python3 -c "print(int($count*0.8))") \
37
+ --val_count $(python3 -c "print(int($count*0.1))")
38
+ [[ $? -ne 0 ]] && return 1
39
+
40
+ if [[ "$do_review" == 1 ]]; then
41
+ local subset
42
+ for subset in train test val; do
43
+ roofai_dataset_review \
44
+ dryrun=$do_dryrun \
45
+ $dataset_object_name \
46
+ --index 0 \
47
+ --subset $subset
48
+ [[ $? -ne 0 ]] && return 1
49
+ done
50
+ fi
51
+
52
+ roofai_semseg_train \
53
+ ~download,$train_options \
54
+ $dataset_object_name \
55
+ $model_object_name \
56
+ --classes affected \
57
+ --epoch_count $epoch_count
58
+ }
@@ -18,6 +18,8 @@ function test_blue_sandbox_help() {
18
18
  "palisades" \
19
19
  "palisades ingest" \
20
20
  "palisades label" \
21
+ "palisades predict" \
22
+ "palisades train" \
21
23
  \
22
24
  "blue_sandbox"; do
23
25
  abcli_eval ,$options \
@@ -0,0 +1,10 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_blue_sandbox_palisades_predict() {
4
+ local options=$1
5
+
6
+ blue_sandbox_palisades_predict \
7
+ ,$options \
8
+ palisades-dataset-v1-ingest-2025-01-20-520ze1-model-2025-01-20-s5xtkp \
9
+ datacube-maxar_open_data-WildFires-LosAngeles-Jan-2025-11-031311102213-103001010B9A1B00
10
+ }
@@ -3,17 +3,11 @@
3
3
  function test_blue_sandbox_palisades_train() {
4
4
  local options=$1
5
5
 
6
- local query_object_name=palisades-dataset-v1
7
-
8
- # test is empty; train causes the github worker to crash.
9
- abcli_eval ,$options \
10
- roofai_dataset_review download \
11
- $query_object_name \
12
- --index 0 \
13
- --subset test
14
- [[ $? -ne 0 ]] && return 1
15
-
16
- abcli_hr
17
-
18
- # next step
6
+ blue_sandbox_palisades_train \
7
+ review,~upload,$options \
8
+ palisades-dataset-v1 \
9
+ count=1000 \
10
+ - \
11
+ epochs=1 \
12
+ -
19
13
  }
blue_sandbox/__init__.py CHANGED
@@ -4,7 +4,7 @@ ICON = "🌀"
4
4
 
5
5
  DESCRIPTION = f"{ICON} A sandbox for ideas and experiments."
6
6
 
7
- VERSION = "5.235.1"
7
+ VERSION = "5.267.1"
8
8
 
9
9
  REPO_NAME = "blue-sandbox"
10
10
 
@@ -1,6 +1,11 @@
1
1
  from typing import List
2
2
 
3
3
  from blue_options.terminal import show_usage, xtra
4
+ from roofai.help.semseg import (
5
+ train_options,
6
+ device_and_profile_details,
7
+ predict_options,
8
+ )
4
9
 
5
10
  from blue_geo.watch.targets.target_list import TargetList
6
11
  from blue_geo.help.datacube import scope_details
@@ -66,7 +71,63 @@ def help_label(
66
71
  )
67
72
 
68
73
 
74
+ def help_predict(
75
+ tokens: List[str],
76
+ mono: bool,
77
+ ) -> str:
78
+ return show_usage(
79
+ [
80
+ "palisades",
81
+ "predict",
82
+ f"[{predict_options(mono=mono)}]",
83
+ "[..|<model-object-name>]",
84
+ "[.|<datacube-id>]",
85
+ "[-|<prediction-object-name>]",
86
+ ],
87
+ "<datacube-id> -<model-object-name>-> <prediction-object-name>",
88
+ device_and_profile_details,
89
+ mono=mono,
90
+ )
91
+
92
+
93
+ def help_train(
94
+ tokens: List[str],
95
+ mono: bool,
96
+ ) -> str:
97
+ options = xtra("dryrun,~download,review", mono=mono)
98
+
99
+ ingest_options = "".join(
100
+ [
101
+ "count=<10000>",
102
+ xtra(",dryrun,upload", mono=mono),
103
+ ]
104
+ )
105
+
106
+ return show_usage(
107
+ [
108
+ "palisades",
109
+ "train",
110
+ f"[{options}]",
111
+ "[.|<query-object-name>]",
112
+ f"[{ingest_options}]",
113
+ "[-|<dataset-object-name>]",
114
+ "[{},epochs=<5>]".format(
115
+ train_options(
116
+ mono=mono,
117
+ show_download=False,
118
+ )
119
+ ),
120
+ "[-|<model-object-name>]",
121
+ ],
122
+ "train palisades.",
123
+ device_and_profile_details,
124
+ mono=mono,
125
+ )
126
+
127
+
69
128
  help_functions = {
70
129
  "ingest": help_ingest,
71
130
  "label": help_label,
131
+ "predict": help_predict,
132
+ "train": help_train,
72
133
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_sandbox
3
- Version: 5.235.1
3
+ Version: 5.267.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)
@@ -64,4 +64,4 @@ pip install blue-sandbox
64
64
 
65
65
  [![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)
66
66
 
67
- built by 🌀 [`blue_options-4.192.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.235.1`](https://github.com/kamangir/blue-sandbox).
67
+ built by 🌀 [`blue_options-4.192.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.267.1`](https://github.com/kamangir/blue-sandbox).
@@ -1,5 +1,5 @@
1
1
  blue_sandbox/README.py,sha256=wy5C7hkd-_RB9HZAmyt75Uevjpxg6Ok7t9SkET3QKHI,2077
2
- blue_sandbox/__init__.py,sha256=czuzczvNKN4XZIGpH8i77OaxZ9jHmIacrWTVo23oNqc,323
2
+ blue_sandbox/__init__.py,sha256=SMpxRl7_5kEtDSXsmHp_8l77Y6Aqdq_sgSFuU1k1o0w,323
3
3
  blue_sandbox/__main__.py,sha256=aPRHSpGpk-bDbzhHpfLNsd3y1gGEHpnhoTF-RBweNwc,361
4
4
  blue_sandbox/config.env,sha256=jTPIS1Tpbkj1b28ynqB1atEtkjQfJ04SJC56bLWGnAs,496
5
5
  blue_sandbox/env.py,sha256=gMeUa11uAiiIPPqcXVsELkpxmEbqU0qVoSjwQpH-vw0,747
@@ -28,25 +28,28 @@ blue_sandbox/.abcli/microsoft_building_damage_assessment/train.sh,sha256=XyTTFB2
28
28
  blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest/list.sh,sha256=9bEjpbwO7Heqd-E2RTM-ck4Q39Eqsv4ged6e0WmxmSs,452
29
29
  blue_sandbox/.abcli/palisades/ingest.sh,sha256=o5SeMhCfYLYMIG-VMjA2mFvACzWVaWV6H8p1khoFBvc,1018
30
30
  blue_sandbox/.abcli/palisades/label.sh,sha256=YyYhbtLt8EQKKWyV1ZYQiS6Ke9W0hTOjQdpgoNUj1sc,709
31
+ blue_sandbox/.abcli/palisades/predict.sh,sha256=f0XPqQthz_RmWyUhuuuQ04q2WHS6BkVG1dvxcLTB8GQ,1313
32
+ blue_sandbox/.abcli/palisades/train.sh,sha256=MctMmuvzE-HRYWHzt1TWWDeZYrQGByOhyQxG-mDJhN4,1927
31
33
  blue_sandbox/.abcli/sagesemseg/cache_dataset.sh,sha256=oAXW1AGer6tuLBQrdNqz7VyMIQtubMXDeUg4crkQiqM,1335
32
34
  blue_sandbox/.abcli/sagesemseg/consts.sh,sha256=xKVE1hAzVPqz0SkY_0h7Fpgy1OEQOFsf3sQHfLHgnQ4,95
33
35
  blue_sandbox/.abcli/sagesemseg/train.sh,sha256=4y7YjlB2k9FW6SbE2c4JRJ9L0qxI3yQcCaZWJvmNUxQ,1606
34
36
  blue_sandbox/.abcli/sagesemseg/upload_dataset.sh,sha256=VZs7VKglLPpizVMjPcfMcL5TRJ7BRFPAOz8_nok2608,1542
35
37
  blue_sandbox/.abcli/tests/README.sh,sha256=rmJM-BPnTcmpPbJ5GXsF8vd_a84JKryeKkZyVScUing,145
36
- blue_sandbox/.abcli/tests/help.sh,sha256=1eHLBnrsqFLuFefH5W4_MHMRB0IMUrGz-j5NLCF_Dgo,612
38
+ blue_sandbox/.abcli/tests/help.sh,sha256=kXsswOWaVmnJg-KZieE59Klqoi1CN4jW4keHEfbJsf0,670
37
39
  blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest.sh,sha256=oUUF8Kuyohxiqxo9FLY9EO0qlgkagntgfuFda6niHeM,426
38
40
  blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest_list.sh,sha256=5P0H-FHV7YKt1fenXAs_0cSFhJYWZ9u3LzRpfSRSptw,577
39
41
  blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_label.sh,sha256=Envac5i9eGa5usDCO8MYfGFfyAZAT-f0KrrsAkaR91U,311
40
42
  blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_train.sh,sha256=0FlwyR1drn6wAKX9IHU_ma7WTmH1Iv8DoTNsdsyj3PA,533
41
43
  blue_sandbox/.abcli/tests/palisades_ingest.sh,sha256=1f7P-ARKXmsDkRg41hp3_RCp8FEeiWQdibG7lmB3YKE,642
42
44
  blue_sandbox/.abcli/tests/palisades_label.sh,sha256=R1lQmsiVj1T2CumNGjFVmXpjJoGbrmH1xbLxj6KBltM,506
43
- blue_sandbox/.abcli/tests/palisades_train.sh,sha256=XDgr2zvMbVVdKccRUCpqofy70h0oUsFsBA4Gm1XI6qk,406
45
+ blue_sandbox/.abcli/tests/palisades_predict.sh,sha256=TBTvcBXXJ_Rj2AOSdoWH3XTxmA7XUW3TZkcPhJNMlIc,328
46
+ blue_sandbox/.abcli/tests/palisades_train.sh,sha256=tF3CksanJcktL45dVA2bHLWHg0DZDp5x_lO0jcpH_5Y,255
44
47
  blue_sandbox/.abcli/tests/sagesemseg_train.sh,sha256=Fz2yzxub7x4SgQAr1ctZIbX6YwJR8HHTEgXcou4dORw,799
45
48
  blue_sandbox/.abcli/tests/version.sh,sha256=jF8zoJN1eKE3LfDeRVG9uHEosmEVJX6RtKfdioyeN-o,150
46
49
  blue_sandbox/help/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
47
50
  blue_sandbox/help/__main__.py,sha256=3Cqp5oISrZCOUApmwoQoCj_0sQgtkiEkm_ob3LFKzRE,234
48
51
  blue_sandbox/help/functions.py,sha256=-AOhYAowmqulhAjrr5B6-AwIDuhZoS0I45flDbt_XRA,541
49
- blue_sandbox/help/palisades.py,sha256=m9izE1-s3ahgcOQ-iR00IQRllDws4G9wB2WXEzxu39U,1627
52
+ blue_sandbox/help/palisades.py,sha256=OXNLUyjCMBuc3yvJGkABlyzTZP-NRQPtg1dfttN1kk4,3040
50
53
  blue_sandbox/microsoft_building_damage_assessment/README.py,sha256=qqe1wXoc4TjKS4o3gskwNCBuX8PTVduQEAaVHeovsrE,1275
51
54
  blue_sandbox/microsoft_building_damage_assessment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
55
  blue_sandbox/microsoft_building_damage_assessment/__main__.py,sha256=RnyXyJdLmzLzccVmb6VZvD17Dwx-g1wByDugIisoPmQ,1995
@@ -54,8 +57,8 @@ blue_sandbox/microsoft_building_damage_assessment/ingest.py,sha256=tBchn4dWPIqAr
54
57
  blue_sandbox/microsoft_building_damage_assessment/label.py,sha256=mpRNOsF8ChxSLwOyvwGmXiD7aO2xfivJPZTC5qwnLaw,823
55
58
  blue_sandbox/microsoft_building_damage_assessment/sas_token.py,sha256=t6oTXc6C52CH3tFbQo2H9YUB_7upAsfUwws43Iu9pHI,214
56
59
  blue_sandbox/microsoft_building_damage_assessment/train.py,sha256=8DUt0S4LuKkRIi9XpASOg5skPaM3D2VaSBg5FEn8qog,2778
57
- blue_sandbox-5.235.1.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
58
- blue_sandbox-5.235.1.dist-info/METADATA,sha256=v5rpf__yFCe-H0QNQFEPg2aIabZtdw_wN0EA9p_1tXY,3761
59
- blue_sandbox-5.235.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
60
- blue_sandbox-5.235.1.dist-info/top_level.txt,sha256=4D9Cb9QUCaqdYAmBiCwvtlaYBtUYVVxv0Sxcr_pzgS8,13
61
- blue_sandbox-5.235.1.dist-info/RECORD,,
60
+ blue_sandbox-5.267.1.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
61
+ blue_sandbox-5.267.1.dist-info/METADATA,sha256=KWLuZg99Vmxqol8cUGF0RIZrNlOu_JkzqsanwGJnDXk,3761
62
+ blue_sandbox-5.267.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
63
+ blue_sandbox-5.267.1.dist-info/top_level.txt,sha256=4D9Cb9QUCaqdYAmBiCwvtlaYBtUYVVxv0Sxcr_pzgS8,13
64
+ blue_sandbox-5.267.1.dist-info/RECORD,,