Spaces:
Runtime error
Runtime error
initial commit
Browse files- .gitignore +1 -0
- .vscode/settings.json +4 -0
- app.py +24 -0
- model.pkl +3 -0
- requirements.txt +95 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
venv
|
.vscode/settings.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"python.linting.flake8Enabled": true,
|
3 |
+
"python.linting.enabled": true
|
4 |
+
}
|
app.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fastai.vision.all import PILImage, load_learner
|
3 |
+
|
4 |
+
learn = load_learner("model.pkl")
|
5 |
+
labels = learn.dls.vocab
|
6 |
+
|
7 |
+
|
8 |
+
def predict(img):
|
9 |
+
img = PILImage.create(img)
|
10 |
+
pred, pred_idx, probs = learn.predict(img)
|
11 |
+
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
12 |
+
|
13 |
+
|
14 |
+
gradio_interface = gr.Interface(
|
15 |
+
fn=predict,
|
16 |
+
inputs=gr.inputs.Image(shape=(512, 512)),
|
17 |
+
outputs=gr.outputs.Label(num_top_classes=2),
|
18 |
+
allow_flagging="never",
|
19 |
+
live=True,
|
20 |
+
title="Angry Carroll Detector",
|
21 |
+
description="Is it Nunez or Carroll? Upload a picture of either and we'll \
|
22 |
+
help you figure out which one it is!",
|
23 |
+
)
|
24 |
+
gradio_interface.launch(share=True)
|
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:81911c48437571a2af70a2db8f2890729b0f65fdd08969f98d90ebdd8fce7264
|
3 |
+
size 46953007
|
requirements.txt
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
aiohttp==3.8.3
|
2 |
+
aiosignal==1.2.0
|
3 |
+
anyio==3.6.2
|
4 |
+
async-timeout==4.0.2
|
5 |
+
attrs==22.1.0
|
6 |
+
bcrypt==4.0.1
|
7 |
+
black==22.10.0
|
8 |
+
blis==0.7.9
|
9 |
+
catalogue==2.0.8
|
10 |
+
certifi==2022.9.24
|
11 |
+
cffi==1.15.1
|
12 |
+
charset-normalizer==2.1.1
|
13 |
+
click==8.1.3
|
14 |
+
confection==0.0.3
|
15 |
+
contourpy==1.0.5
|
16 |
+
cryptography==38.0.1
|
17 |
+
cycler==0.11.0
|
18 |
+
cymem==2.0.7
|
19 |
+
fastai==2.7.9
|
20 |
+
fastapi==0.85.1
|
21 |
+
fastcore==1.5.27
|
22 |
+
fastdownload==0.0.7
|
23 |
+
fastprogress==1.0.3
|
24 |
+
ffmpy==0.3.0
|
25 |
+
flake8==5.0.4
|
26 |
+
fonttools==4.38.0
|
27 |
+
frozenlist==1.3.1
|
28 |
+
fsspec==2022.10.0
|
29 |
+
gradio==3.6
|
30 |
+
h11==0.12.0
|
31 |
+
httpcore==0.15.0
|
32 |
+
httpx==0.23.0
|
33 |
+
idna==3.4
|
34 |
+
Jinja2==3.1.2
|
35 |
+
joblib==1.2.0
|
36 |
+
kiwisolver==1.4.4
|
37 |
+
langcodes==3.3.0
|
38 |
+
linkify-it-py==1.0.3
|
39 |
+
markdown-it-py==2.1.0
|
40 |
+
MarkupSafe==2.1.1
|
41 |
+
matplotlib==3.6.1
|
42 |
+
mccabe==0.7.0
|
43 |
+
mdit-py-plugins==0.3.1
|
44 |
+
mdurl==0.1.2
|
45 |
+
multidict==6.0.2
|
46 |
+
murmurhash==1.0.9
|
47 |
+
mypy-extensions==0.4.3
|
48 |
+
numpy==1.23.4
|
49 |
+
orjson==3.8.0
|
50 |
+
packaging==21.3
|
51 |
+
pandas==1.5.1
|
52 |
+
paramiko==2.11.0
|
53 |
+
pathspec==0.10.1
|
54 |
+
pathy==0.6.2
|
55 |
+
Pillow==9.2.0
|
56 |
+
platformdirs==2.5.2
|
57 |
+
preshed==3.0.8
|
58 |
+
pycodestyle==2.9.1
|
59 |
+
pycparser==2.21
|
60 |
+
pycryptodome==3.15.0
|
61 |
+
pydantic==1.10.2
|
62 |
+
pydub==0.25.1
|
63 |
+
pyflakes==2.5.0
|
64 |
+
PyNaCl==1.5.0
|
65 |
+
pyparsing==3.0.9
|
66 |
+
python-dateutil==2.8.2
|
67 |
+
python-multipart==0.0.5
|
68 |
+
pytz==2022.5
|
69 |
+
PyYAML==6.0
|
70 |
+
requests==2.28.1
|
71 |
+
rfc3986==1.5.0
|
72 |
+
scikit-learn==1.1.2
|
73 |
+
scipy==1.9.3
|
74 |
+
six==1.16.0
|
75 |
+
smart-open==5.2.1
|
76 |
+
sniffio==1.3.0
|
77 |
+
spacy==3.4.2
|
78 |
+
spacy-legacy==3.0.10
|
79 |
+
spacy-loggers==1.0.3
|
80 |
+
srsly==2.4.5
|
81 |
+
starlette==0.20.4
|
82 |
+
thinc==8.1.5
|
83 |
+
threadpoolctl==3.1.0
|
84 |
+
tomli==2.0.1
|
85 |
+
torch==1.12.1
|
86 |
+
torchvision==0.13.1
|
87 |
+
tqdm==4.64.1
|
88 |
+
typer==0.4.2
|
89 |
+
typing_extensions==4.4.0
|
90 |
+
uc-micro-py==1.0.1
|
91 |
+
urllib3==1.26.12
|
92 |
+
uvicorn==0.19.0
|
93 |
+
wasabi==0.10.1
|
94 |
+
websockets==10.3
|
95 |
+
yarl==1.8.1
|