update
Browse files- README.md +1 -1
- app.ipynb +15 -14
- app.py +4 -11
- requirements.txt +181 -0
- tradiotional_clothing_recognition-v0.pth +3 -0
README.md
CHANGED
@@ -12,4 +12,4 @@ license: apache-2.0
|
|
12 |
|
13 |
HuggingFace Spaces App URL: https://huggingface.co/spaces/msideadman/cap-recognizer
|
14 |
|
15 |
-
Gradio App URL: https://
|
|
|
12 |
|
13 |
HuggingFace Spaces App URL: https://huggingface.co/spaces/msideadman/cap-recognizer
|
14 |
|
15 |
+
Gradio App URL: https://897f24d5bf9ba00855.gradio.live
|
app.ipynb
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {
|
7 |
"colab": {
|
8 |
"base_uri": "https://localhost:8080/"
|
@@ -47,7 +47,7 @@
|
|
47 |
},
|
48 |
{
|
49 |
"cell_type": "code",
|
50 |
-
"execution_count":
|
51 |
"metadata": {
|
52 |
"id": "KjVdtCKTWf4g"
|
53 |
},
|
@@ -58,7 +58,7 @@
|
|
58 |
},
|
59 |
{
|
60 |
"cell_type": "code",
|
61 |
-
"execution_count":
|
62 |
"metadata": {
|
63 |
"id": "SBhTQPpDWlLE"
|
64 |
},
|
@@ -71,19 +71,19 @@
|
|
71 |
},
|
72 |
{
|
73 |
"cell_type": "code",
|
74 |
-
"execution_count":
|
75 |
"metadata": {
|
76 |
"id": "sSpSwwC1Wny7"
|
77 |
},
|
78 |
"outputs": [],
|
79 |
"source": [
|
80 |
"#!export\n",
|
81 |
-
"model = load_learner('
|
82 |
]
|
83 |
},
|
84 |
{
|
85 |
"cell_type": "code",
|
86 |
-
"execution_count":
|
87 |
"metadata": {
|
88 |
"id": "j2TCH9wVXe7c"
|
89 |
},
|
@@ -121,7 +121,7 @@
|
|
121 |
},
|
122 |
{
|
123 |
"cell_type": "code",
|
124 |
-
"execution_count":
|
125 |
"metadata": {
|
126 |
"colab": {
|
127 |
"base_uri": "https://localhost:8080/",
|
@@ -144,14 +144,14 @@
|
|
144 |
}
|
145 |
],
|
146 |
"source": [
|
147 |
-
"img = PILImage.create(f'
|
148 |
"img.thumbnail((192,192))\n",
|
149 |
"img"
|
150 |
]
|
151 |
},
|
152 |
{
|
153 |
"cell_type": "code",
|
154 |
-
"execution_count":
|
155 |
"metadata": {
|
156 |
"colab": {
|
157 |
"base_uri": "https://localhost:8080/",
|
@@ -237,7 +237,7 @@
|
|
237 |
},
|
238 |
{
|
239 |
"cell_type": "code",
|
240 |
-
"execution_count":
|
241 |
"metadata": {
|
242 |
"colab": {
|
243 |
"base_uri": "https://localhost:8080/"
|
@@ -284,8 +284,8 @@
|
|
284 |
"image = gr.inputs.Image(shape=(192,192))\n",
|
285 |
"label = gr.outputs.Label()\n",
|
286 |
"examples = [\n",
|
287 |
-
" '
|
288 |
-
" '
|
289 |
" ]\n",
|
290 |
"\n",
|
291 |
"iface = gr.Interface(fn=recognize_image, inputs=image, outputs=label, examples=examples)\n",
|
@@ -304,7 +304,7 @@
|
|
304 |
},
|
305 |
{
|
306 |
"cell_type": "code",
|
307 |
-
"execution_count":
|
308 |
"metadata": {
|
309 |
"colab": {
|
310 |
"base_uri": "https://localhost:8080/"
|
@@ -383,7 +383,8 @@
|
|
383 |
"name": "python3"
|
384 |
},
|
385 |
"language_info": {
|
386 |
-
"name": "python"
|
|
|
387 |
}
|
388 |
},
|
389 |
"nbformat": 4,
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": null,
|
6 |
"metadata": {
|
7 |
"colab": {
|
8 |
"base_uri": "https://localhost:8080/"
|
|
|
47 |
},
|
48 |
{
|
49 |
"cell_type": "code",
|
50 |
+
"execution_count": null,
|
51 |
"metadata": {
|
52 |
"id": "KjVdtCKTWf4g"
|
53 |
},
|
|
|
58 |
},
|
59 |
{
|
60 |
"cell_type": "code",
|
61 |
+
"execution_count": null,
|
62 |
"metadata": {
|
63 |
"id": "SBhTQPpDWlLE"
|
64 |
},
|
|
|
71 |
},
|
72 |
{
|
73 |
"cell_type": "code",
|
74 |
+
"execution_count": null,
|
75 |
"metadata": {
|
76 |
"id": "sSpSwwC1Wny7"
|
77 |
},
|
78 |
"outputs": [],
|
79 |
"source": [
|
80 |
"#!export\n",
|
81 |
+
"model = load_learner('tradiotional_clothing_recognition-v1.pkl')"
|
82 |
]
|
83 |
},
|
84 |
{
|
85 |
"cell_type": "code",
|
86 |
+
"execution_count": null,
|
87 |
"metadata": {
|
88 |
"id": "j2TCH9wVXe7c"
|
89 |
},
|
|
|
121 |
},
|
122 |
{
|
123 |
"cell_type": "code",
|
124 |
+
"execution_count": null,
|
125 |
"metadata": {
|
126 |
"colab": {
|
127 |
"base_uri": "https://localhost:8080/",
|
|
|
144 |
}
|
145 |
],
|
146 |
"source": [
|
147 |
+
"img = PILImage.create(f'unknown-1.jpg')\n",
|
148 |
"img.thumbnail((192,192))\n",
|
149 |
"img"
|
150 |
]
|
151 |
},
|
152 |
{
|
153 |
"cell_type": "code",
|
154 |
+
"execution_count": null,
|
155 |
"metadata": {
|
156 |
"colab": {
|
157 |
"base_uri": "https://localhost:8080/",
|
|
|
237 |
},
|
238 |
{
|
239 |
"cell_type": "code",
|
240 |
+
"execution_count": null,
|
241 |
"metadata": {
|
242 |
"colab": {
|
243 |
"base_uri": "https://localhost:8080/"
|
|
|
284 |
"image = gr.inputs.Image(shape=(192,192))\n",
|
285 |
"label = gr.outputs.Label()\n",
|
286 |
"examples = [\n",
|
287 |
+
" 'unknown-1.jpg',\n",
|
288 |
+
" 'unknown-2.jpg',\n",
|
289 |
" ]\n",
|
290 |
"\n",
|
291 |
"iface = gr.Interface(fn=recognize_image, inputs=image, outputs=label, examples=examples)\n",
|
|
|
304 |
},
|
305 |
{
|
306 |
"cell_type": "code",
|
307 |
+
"execution_count": null,
|
308 |
"metadata": {
|
309 |
"colab": {
|
310 |
"base_uri": "https://localhost:8080/"
|
|
|
383 |
"name": "python3"
|
384 |
},
|
385 |
"language_info": {
|
386 |
+
"name": "python",
|
387 |
+
"version": "3.9.7"
|
388 |
}
|
389 |
},
|
390 |
"nbformat": 4,
|
app.py
CHANGED
@@ -1,18 +1,9 @@
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
|
4 |
-
from pathlib import Path
|
5 |
|
6 |
-
# file_path = 'tradiotional_clothing_recognition-v1.pkl'
|
7 |
-
# model = load_learner(str(file_path))
|
8 |
|
9 |
-
|
10 |
-
# model = load_learner('tradiotional_clothing_recognition-v1.pkl')
|
11 |
-
|
12 |
-
import os
|
13 |
-
|
14 |
-
file_path = os.path.join('tradiotional_clothing_recognition-v1.pkl')
|
15 |
-
model = load_learner(file_path)
|
16 |
|
17 |
|
18 |
categories = model.dls.vocab
|
@@ -30,4 +21,6 @@ examples = [
|
|
30 |
]
|
31 |
|
32 |
iface = gr.Interface(fn=recognize_image, inputs=image, outputs=label, examples=examples)
|
33 |
-
iface.launch(inline=False)
|
|
|
|
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
|
|
|
4 |
|
|
|
|
|
5 |
|
6 |
+
model = load_learner('tradiotional_clothing_recognition-v1.pkl')
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
|
9 |
categories = model.dls.vocab
|
|
|
21 |
]
|
22 |
|
23 |
iface = gr.Interface(fn=recognize_image, inputs=image, outputs=label, examples=examples)
|
24 |
+
iface.launch(inline=False)
|
25 |
+
|
26 |
+
|
requirements.txt
CHANGED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
aiofiles==23.1.0
|
2 |
+
aiohttp==3.8.4
|
3 |
+
aiosignal==1.3.1
|
4 |
+
altair==5.0.1
|
5 |
+
anyio==3.7.0
|
6 |
+
argon2-cffi==21.3.0
|
7 |
+
argon2-cffi-bindings==21.2.0
|
8 |
+
arrow==1.2.3
|
9 |
+
asttokens==2.2.1
|
10 |
+
astunparse==1.6.3
|
11 |
+
async-timeout==4.0.2
|
12 |
+
attrs==23.1.0
|
13 |
+
backcall==0.2.0
|
14 |
+
beautifulsoup4==4.12.2
|
15 |
+
bleach==6.0.0
|
16 |
+
blis==0.7.9
|
17 |
+
catalogue==2.0.8
|
18 |
+
certifi==2023.5.7
|
19 |
+
cffi==1.15.1
|
20 |
+
charset-normalizer==3.1.0
|
21 |
+
click==8.1.3
|
22 |
+
colorama==0.4.6
|
23 |
+
comm==0.1.3
|
24 |
+
confection==0.0.4
|
25 |
+
contourpy==1.1.0
|
26 |
+
cycler==0.11.0
|
27 |
+
cymem==2.0.7
|
28 |
+
datasets==2.13.0
|
29 |
+
debugpy==1.6.7
|
30 |
+
decorator==5.1.1
|
31 |
+
defusedxml==0.7.1
|
32 |
+
dill==0.3.6
|
33 |
+
exceptiongroup==1.1.1
|
34 |
+
execnb==0.1.5
|
35 |
+
executing==1.2.0
|
36 |
+
fastai==2.7.12
|
37 |
+
fastapi==0.97.0
|
38 |
+
fastbook==0.0.29
|
39 |
+
fastcore==1.5.29
|
40 |
+
fastdownload==0.0.7
|
41 |
+
fastjsonschema==2.17.1
|
42 |
+
fastprogress==1.0.3
|
43 |
+
ffmpy==0.3.0
|
44 |
+
filelock==3.12.2
|
45 |
+
fonttools==4.40.0
|
46 |
+
fqdn==1.5.1
|
47 |
+
frozenlist==1.3.3
|
48 |
+
fsspec==2023.6.0
|
49 |
+
ghapi==1.0.4
|
50 |
+
gradio==3.35.2
|
51 |
+
gradio_client==0.2.7
|
52 |
+
graphviz==0.20.1
|
53 |
+
h11==0.14.0
|
54 |
+
httpcore==0.17.2
|
55 |
+
httpx==0.24.1
|
56 |
+
huggingface-hub==0.15.1
|
57 |
+
idna==3.4
|
58 |
+
importlib-metadata==6.7.0
|
59 |
+
importlib-resources==5.12.0
|
60 |
+
ipykernel==6.23.2
|
61 |
+
ipython==8.14.0
|
62 |
+
ipython-genutils==0.2.0
|
63 |
+
ipywidgets==7.7.5
|
64 |
+
isoduration==20.11.0
|
65 |
+
jedi==0.18.2
|
66 |
+
Jinja2==3.1.2
|
67 |
+
joblib==1.2.0
|
68 |
+
jsonpointer==2.4
|
69 |
+
jsonschema==4.17.3
|
70 |
+
jupyter-events==0.6.3
|
71 |
+
jupyter_client==8.2.0
|
72 |
+
jupyter_core==5.3.1
|
73 |
+
jupyter_server==2.6.0
|
74 |
+
jupyter_server_terminals==0.4.4
|
75 |
+
jupyterlab-pygments==0.2.2
|
76 |
+
jupyterlab-widgets==1.1.4
|
77 |
+
kiwisolver==1.4.4
|
78 |
+
langcodes==3.3.0
|
79 |
+
linkify-it-py==2.0.2
|
80 |
+
markdown-it-py==2.2.0
|
81 |
+
MarkupSafe==2.1.3
|
82 |
+
matplotlib==3.7.1
|
83 |
+
matplotlib-inline==0.1.6
|
84 |
+
mdit-py-plugins==0.3.3
|
85 |
+
mdurl==0.1.2
|
86 |
+
mistune==3.0.1
|
87 |
+
mpmath==1.3.0
|
88 |
+
multidict==6.0.4
|
89 |
+
multiprocess==0.70.14
|
90 |
+
murmurhash==1.0.9
|
91 |
+
nbclassic==1.0.0
|
92 |
+
nbclient==0.8.0
|
93 |
+
nbconvert==7.6.0
|
94 |
+
nbdev==2.3.12
|
95 |
+
nbformat==5.9.0
|
96 |
+
nest-asyncio==1.5.6
|
97 |
+
networkx==3.1
|
98 |
+
notebook==6.5.4
|
99 |
+
notebook_shim==0.2.3
|
100 |
+
numpy==1.25.0
|
101 |
+
orjson==3.9.1
|
102 |
+
overrides==7.3.1
|
103 |
+
packaging==23.1
|
104 |
+
pandas==2.0.2
|
105 |
+
pandocfilters==1.5.0
|
106 |
+
parso==0.8.3
|
107 |
+
pathy==0.10.2
|
108 |
+
pickleshare==0.7.5
|
109 |
+
Pillow==9.5.0
|
110 |
+
platformdirs==3.6.0
|
111 |
+
preshed==3.0.8
|
112 |
+
prometheus-client==0.17.0
|
113 |
+
prompt-toolkit==3.0.38
|
114 |
+
psutil==5.9.5
|
115 |
+
pure-eval==0.2.2
|
116 |
+
pyarrow==12.0.1
|
117 |
+
pycparser==2.21
|
118 |
+
pydantic==1.10.9
|
119 |
+
pydub==0.25.1
|
120 |
+
Pygments==2.15.1
|
121 |
+
pyparsing==3.1.0
|
122 |
+
pyrsistent==0.19.3
|
123 |
+
python-dateutil==2.8.2
|
124 |
+
python-json-logger==2.0.7
|
125 |
+
python-multipart==0.0.6
|
126 |
+
pytz==2023.3
|
127 |
+
pywin32==306
|
128 |
+
pywinpty==2.0.10
|
129 |
+
PyYAML==6.0
|
130 |
+
pyzmq==25.1.0
|
131 |
+
regex==2023.6.3
|
132 |
+
requests==2.31.0
|
133 |
+
rfc3339-validator==0.1.4
|
134 |
+
rfc3986-validator==0.1.1
|
135 |
+
safetensors==0.3.1
|
136 |
+
scikit-learn==1.2.2
|
137 |
+
scipy==1.10.1
|
138 |
+
semantic-version==2.10.0
|
139 |
+
Send2Trash==1.8.2
|
140 |
+
sentencepiece==0.1.99
|
141 |
+
six==1.16.0
|
142 |
+
smart-open==6.3.0
|
143 |
+
sniffio==1.3.0
|
144 |
+
soupsieve==2.4.1
|
145 |
+
spacy==3.5.3
|
146 |
+
spacy-legacy==3.0.12
|
147 |
+
spacy-loggers==1.0.4
|
148 |
+
srsly==2.4.6
|
149 |
+
stack-data==0.6.2
|
150 |
+
starlette==0.27.0
|
151 |
+
sympy==1.12
|
152 |
+
terminado==0.17.1
|
153 |
+
thinc==8.1.10
|
154 |
+
threadpoolctl==3.1.0
|
155 |
+
tinycss2==1.2.1
|
156 |
+
tokenizers==0.13.3
|
157 |
+
toolz==0.12.0
|
158 |
+
torch==2.0.1
|
159 |
+
torchvision==0.15.2
|
160 |
+
tornado==6.3.2
|
161 |
+
tqdm==4.65.0
|
162 |
+
traitlets==5.9.0
|
163 |
+
transformers==4.30.2
|
164 |
+
typer==0.7.0
|
165 |
+
typing_extensions==4.6.3
|
166 |
+
tzdata==2023.3
|
167 |
+
uc-micro-py==1.0.2
|
168 |
+
uri-template==1.2.0
|
169 |
+
urllib3==2.0.3
|
170 |
+
uvicorn==0.22.0
|
171 |
+
wasabi==1.1.2
|
172 |
+
watchdog==3.0.0
|
173 |
+
wcwidth==0.2.6
|
174 |
+
webcolors==1.13
|
175 |
+
webencodings==0.5.1
|
176 |
+
websocket-client==1.6.0
|
177 |
+
websockets==11.0.3
|
178 |
+
widgetsnbextension==3.6.4
|
179 |
+
xxhash==3.2.0
|
180 |
+
yarl==1.9.2
|
181 |
+
zipp==3.15.0
|
tradiotional_clothing_recognition-v0.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ba5076af4768481382163976ded46c4351e0fd8e826ccb8281b6583f58fe6be8
|
3 |
+
size 87619302
|