kamangir commited on
Commit ·
e773d9a
1
Parent(s): f478c26
+= README.md - kamangir/bolt#692
Browse files- README.md +45 -2
- abcli/assets/fashion_mnist_browsed.png +0 -0
- abcli/assets/fashion_mnist_list.png +0 -0
- abcli/image_classifier.sh +5 -0
- image_classifier/__init__.py +1 -1
README.md
CHANGED
|
@@ -2,7 +2,50 @@
|
|
| 2 |
license: cc
|
| 3 |
---
|
| 4 |
|
| 5 |
-
#
|
| 6 |
|
| 7 |
-
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: cc
|
| 3 |
---
|
| 4 |
|
| 5 |
+
# Image Classifier
|
| 6 |
|
| 7 |
+
An extendable TensorFlow image classifier w/ a Bash cli and Hugging Face integration.
|
| 8 |
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
`image-classifier` is an [awesome-bash-cli](https://github.com/kamangir/awesome-bash-cli) plugin - to see the list of commands added by `image_classifier` complete [installation](#Installation) and type in:
|
| 12 |
+
|
| 13 |
+
```
|
| 14 |
+
abc image_classifier ?
|
| 15 |
+
abc fashion_mnist ?
|
| 16 |
+
```
|
| 17 |
+
## Installation
|
| 18 |
+
|
| 19 |
+
Install and configure [awesome-bash-cli](https://github.com/kamangir/awesome-bash-cli), then run:
|
| 20 |
+
|
| 21 |
+
```
|
| 22 |
+
abc huggingface clone image-classifier
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
## example1
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
|
| 29 |
+
`fashion_mnist` is an `image_classifier` trained on [Fashion-MNIST](https://github.com/zalandoresearch/fashion-mnist).
|
| 30 |
+
|
| 31 |
+
To retrain `fashion_mnist` type in:
|
| 32 |
+
|
| 33 |
+
```
|
| 34 |
+
abc select
|
| 35 |
+
abc fashion_mnist train
|
| 36 |
+
abc upload
|
| 37 |
+
abc image_classifier list . model=object,browser
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
You should now see the structure of the network (left) and the content of the model (right).
|
| 41 |
+
|
| 42 |
+
|  |  |
|
| 43 |
+
|---|---|
|
| 44 |
+
|
| 45 |
+
You can save this model under a new name by typing in:
|
| 46 |
+
|
| 47 |
+
```
|
| 48 |
+
abc fashion_mnist save new_name .
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
/ END
|
abcli/assets/fashion_mnist_browsed.png
ADDED
|
abcli/assets/fashion_mnist_list.png
ADDED
|
abcli/image_classifier.sh
CHANGED
|
@@ -45,6 +45,7 @@ function abcli_image_classifier() {
|
|
| 45 |
|
| 46 |
local options=$3
|
| 47 |
local model_source=$(abcli_option "$options" "model" saved)
|
|
|
|
| 48 |
|
| 49 |
local model_path=$(abcli_huggingface get_model_path image-classifier "$model_name" "$options")
|
| 50 |
|
|
@@ -58,6 +59,10 @@ function abcli_image_classifier() {
|
|
| 58 |
--model_path $model_path \
|
| 59 |
${@:4}
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
return
|
| 62 |
fi
|
| 63 |
|
|
|
|
| 45 |
|
| 46 |
local options=$3
|
| 47 |
local model_source=$(abcli_option "$options" "model" saved)
|
| 48 |
+
local do_browse=$(abcli_option_get_unpacked "$options" "browser" 0)
|
| 49 |
|
| 50 |
local model_path=$(abcli_huggingface get_model_path image-classifier "$model_name" "$options")
|
| 51 |
|
|
|
|
| 59 |
--model_path $model_path \
|
| 60 |
${@:4}
|
| 61 |
|
| 62 |
+
if [ "$do_browse" == 1 ] && [ "$model_source" == "object" ] ; then
|
| 63 |
+
abcli_browser $model_object
|
| 64 |
+
fi
|
| 65 |
+
|
| 66 |
return
|
| 67 |
fi
|
| 68 |
|
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.185"
|
| 4 |
|
| 5 |
description = "fashion-mnist + hugging-face + awesome-bash-cli"
|