kamangir
commited on
Commit
·
fa18a17
1
Parent(s):
7040b55
validating single image predict for fashion_mnist - kamangir/bolt#692
Browse files- abcli/image_classifier.sh +15 -7
- image_classifier/__init__.py +1 -1
abcli/image_classifier.sh
CHANGED
@@ -8,8 +8,8 @@ function abcli_image_classifier() {
|
|
8 |
local task=$(abcli_unpack_keyword "$1" help)
|
9 |
|
10 |
if [ "$task" == "help" ] ; then
|
11 |
-
abcli_help_line "$abcli_cli_name image_classifier describe object_1" \
|
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 data_1 [name_1] [data=filename/*object/url,model=object/*saved]" \
|
@@ -31,14 +31,22 @@ function abcli_image_classifier() {
|
|
31 |
fi
|
32 |
|
33 |
if [ "$task" == "describe" ] ; then
|
34 |
-
local
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
python3 -m image_classifier \
|
39 |
describe \
|
40 |
-
--model_path $
|
41 |
-
${@:
|
42 |
|
43 |
return
|
44 |
fi
|
@@ -86,7 +94,7 @@ function abcli_image_classifier_predict() {
|
|
86 |
local model_path=$(abcli_huggingface get_model_path image-classifier "$model_name" "$options")
|
87 |
|
88 |
if [ "$model_source" == "object" ] ; then
|
89 |
-
local model_object=$(python3 -c "print('$
|
90 |
abcli_download object $model_object
|
91 |
fi
|
92 |
|
|
|
8 |
local task=$(abcli_unpack_keyword "$1" help)
|
9 |
|
10 |
if [ "$task" == "help" ] ; then
|
11 |
+
abcli_help_line "$abcli_cli_name image_classifier describe object_1 [model=object/*saved]" \
|
12 |
+
"describe saved/object 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 data_1 [name_1] [data=filename/*object/url,model=object/*saved]" \
|
|
|
31 |
fi
|
32 |
|
33 |
if [ "$task" == "describe" ] ; then
|
34 |
+
local model_name=$2
|
35 |
|
36 |
+
local options=$3
|
37 |
+
local model_source=$(abcli_option "$options" "model" saved)
|
38 |
+
|
39 |
+
local model_path=$(abcli_huggingface get_model_path image-classifier "$model_name" "$options")
|
40 |
+
|
41 |
+
if [ "$model_source" == "object" ] ; then
|
42 |
+
local model_object=$(python3 -c "print('$model_path'.split('/')[-1])")
|
43 |
+
abcli_download object $model_object
|
44 |
+
fi
|
45 |
|
46 |
python3 -m image_classifier \
|
47 |
describe \
|
48 |
+
--model_path $model_path \
|
49 |
+
${@:4}
|
50 |
|
51 |
return
|
52 |
fi
|
|
|
94 |
local model_path=$(abcli_huggingface get_model_path image-classifier "$model_name" "$options")
|
95 |
|
96 |
if [ "$model_source" == "object" ] ; then
|
97 |
+
local model_object=$(python3 -c "print('$model_path'.split('/')[-1])")
|
98 |
abcli_download object $model_object
|
99 |
fi
|
100 |
|
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.171"
|
4 |
|
5 |
description = "fashion-mnist + hugging-face + awesome-bash-cli"
|