kamangir
commited on
Commit
•
958fcc3
1
Parent(s):
8bb4db8
saving fashion_mnist - kamangir/bolt#692
Browse files- abcli/fashion_mnist.sh +29 -5
- abcli/image_classifier.sh +6 -4
- image_classifier/__init__.py +1 -1
abcli/fashion_mnist.sh
CHANGED
@@ -10,8 +10,8 @@ function abcli_fashion_mnist() {
|
|
10 |
if [ $task == "help" ] ; then
|
11 |
abcli_help_line "$abcli_cli_name fashion_mnist ingest" \
|
12 |
"ingest fashion_mnist data."
|
13 |
-
abcli_help_line "$abcli_cli_name fashion_mnist predict object_1" \
|
14 |
-
"run fashion_mnist model
|
15 |
abcli_help_line "$abcli_cli_name fashion_mnist save [name_1] [object_1] [force]" \
|
16 |
"[force] save fashion_mnist [in object_1] as name_1."
|
17 |
abcli_help_line "$abcli_cli_name fashion_mnist train [validate]" \
|
@@ -35,14 +35,38 @@ function abcli_fashion_mnist() {
|
|
35 |
fi
|
36 |
|
37 |
if [ "$task" == "predict" ] ; then
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
abcli_image_classifier_predict ${@:2}
|
40 |
return
|
41 |
fi
|
42 |
|
43 |
if [ "$task" == "save" ] ; then
|
44 |
-
|
45 |
-
|
|
|
|
|
46 |
return
|
47 |
fi
|
48 |
|
|
|
10 |
if [ $task == "help" ] ; then
|
11 |
abcli_help_line "$abcli_cli_name fashion_mnist ingest" \
|
12 |
"ingest fashion_mnist data."
|
13 |
+
abcli_help_line "$abcli_cli_name fashion_mnist predict object_1 [name_1] [object]" \
|
14 |
+
"run fashion_mnist saved/object model name_1 predict on object_1."
|
15 |
abcli_help_line "$abcli_cli_name fashion_mnist save [name_1] [object_1] [force]" \
|
16 |
"[force] save fashion_mnist [in object_1] as name_1."
|
17 |
abcli_help_line "$abcli_cli_name fashion_mnist train [validate]" \
|
|
|
35 |
fi
|
36 |
|
37 |
if [ "$task" == "predict" ] ; then
|
38 |
+
local data_object=$(abcli_clarify_object "$2" $abcli_object_name)
|
39 |
+
|
40 |
+
local options=$4
|
41 |
+
local model_is_object=$(abcli_option_get_unpacked "$options" "object" 0)
|
42 |
+
|
43 |
+
if [ "$model_is_object" == 1 ] ; then
|
44 |
+
local model_object=$(abcli_clarify_object "$3")
|
45 |
+
|
46 |
+
abcli_download object $model_object
|
47 |
+
|
48 |
+
local model_path=$abcli_object_root/$model_object
|
49 |
+
else
|
50 |
+
local model_name=$(abcli_clarify_arg "$3" fashion-mnist)
|
51 |
+
|
52 |
+
local model_path=$abcli_path_git/image-classifier/saved_model/$model_name
|
53 |
+
fi
|
54 |
+
|
55 |
+
|
56 |
+
# object_1 [name_1] [object]
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
+
|
61 |
abcli_image_classifier_predict ${@:2}
|
62 |
return
|
63 |
fi
|
64 |
|
65 |
if [ "$task" == "save" ] ; then
|
66 |
+
abcli_huggingface save \
|
67 |
+
image-classifier \
|
68 |
+
$(abcli_clarify_arg "$2" fashion-mnist) \
|
69 |
+
${@:3}
|
70 |
return
|
71 |
fi
|
72 |
|
abcli/image_classifier.sh
CHANGED
@@ -12,8 +12,8 @@ function abcli_image_classifier() {
|
|
12 |
"describe model object_1."
|
13 |
abcli_help_line "$abcli_cli_name image_classifier install" \
|
14 |
"install image_classifier."
|
15 |
-
abcli_help_line "$abcli_cli_name image_classifier predict object_1
|
16 |
-
"run image_classifier model
|
17 |
abcli_help_line "$abcli_cli_name image_classifier save [name_1] [object_1] [force]" \
|
18 |
"[force] save image_classifier [in object_1] [as name_1]."
|
19 |
abcli_help_line "$abcli_cli_name image_classifier train object_1" \
|
@@ -49,8 +49,10 @@ function abcli_image_classifier() {
|
|
49 |
fi
|
50 |
|
51 |
if [ "$task" == "save" ] ; then
|
52 |
-
|
53 |
-
|
|
|
|
|
54 |
return
|
55 |
fi
|
56 |
|
|
|
12 |
"describe model object_1."
|
13 |
abcli_help_line "$abcli_cli_name image_classifier install" \
|
14 |
"install image_classifier."
|
15 |
+
abcli_help_line "$abcli_cli_name image_classifier predict object_1 [name_1] [object]" \
|
16 |
+
"run image_classifier saved/object model name_1 predict on object_1."
|
17 |
abcli_help_line "$abcli_cli_name image_classifier save [name_1] [object_1] [force]" \
|
18 |
"[force] save image_classifier [in object_1] [as name_1]."
|
19 |
abcli_help_line "$abcli_cli_name image_classifier train object_1" \
|
|
|
49 |
fi
|
50 |
|
51 |
if [ "$task" == "save" ] ; then
|
52 |
+
abcli_huggingface save \
|
53 |
+
image-classifier \
|
54 |
+
$(abcli_clarify_arg "$2" image-classifier) \
|
55 |
+
${@:3}
|
56 |
return
|
57 |
fi
|
58 |
|
image_classifier/__init__.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
name = "image_classifier"
|
2 |
|
3 |
-
version = "1.1.
|
4 |
|
5 |
description = "fashion-mnist + hugging-face + awesome-bash-cli"
|
|
|
1 |
name = "image_classifier"
|
2 |
|
3 |
+
version = "1.1.98"
|
4 |
|
5 |
description = "fashion-mnist + hugging-face + awesome-bash-cli"
|