Harshinder Chadha commited on
Commit
1104b35
·
1 Parent(s): 8c88b65

Deploying app to Huggingfaces

Browse files
Files changed (6) hide show
  1. app.py +22 -0
  2. model.pkl +3 -0
  3. requirements.txt +191 -0
  4. sample.png +0 -0
  5. sample2.png +0 -0
  6. sample3.png +0 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTOGENERATED! DO NOT EDIT! File to edit: ../prod.ipynb.
2
+
3
+ # %% auto 0
4
+ __all__ = ['categories', 'image', 'label', 'examples', 'intf', 'classify_image']
5
+
6
+ # %% ../prod.ipynb 1
7
+ from fastai.vision.all import *
8
+ import gradio as gr
9
+
10
+ # %% ../prod.ipynb 5
11
+ categories = ('1990s', '2010s')
12
+ def classify_image(img):
13
+ pred, idx, probs = learner.predict(img)
14
+ return dict(zip(categories, map(float, probs)))
15
+
16
+ # %% ../prod.ipynb 6
17
+ image = gr.Image(shape=(192,192))
18
+ label = gr.Label()
19
+ examples = ['sample.png', 'sample2.png', 'sample3.png']
20
+
21
+ intf = gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)
22
+ intf.launch(inline=False)
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a230257bb67b453e7ad47273ab8d634193a1de0baf55fc197982d3c8f4fa5c1a
3
+ size 87458385
requirements.txt ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ adal==1.2.7
2
+ aiofiles==23.2.1
3
+ aiohttp==3.8.5
4
+ aiosignal==1.3.1
5
+ altair==5.0.1
6
+ annotated-types==0.5.0
7
+ anyio==3.5.0
8
+ appnope==0.1.3
9
+ argon2-cffi==21.3.0
10
+ argon2-cffi-bindings==21.2.0
11
+ asttokens==2.2.1
12
+ astunparse==1.6.3
13
+ async-timeout==4.0.3
14
+ attrs==22.1.0
15
+ azure-cognitiveservices-search-imagesearch==2.0.0
16
+ azure-common==1.1.28
17
+ azure-core==1.29.1
18
+ backcall==0.2.0
19
+ beautifulsoup4==4.12.2
20
+ bleach==4.1.0
21
+ blis==0.7.10
22
+ brotlipy==0.7.0
23
+ catalogue==2.0.9
24
+ certifi==2023.7.22
25
+ cffi==1.15.1
26
+ charset-normalizer==2.0.4
27
+ click==8.1.6
28
+ comm==0.1.4
29
+ confection==0.1.1
30
+ contourpy==1.1.0
31
+ cryptography==41.0.2
32
+ cycler==0.11.0
33
+ cymem==2.0.7
34
+ datasets==2.14.4
35
+ debugpy==1.6.7
36
+ decorator==5.1.1
37
+ defusedxml==0.7.1
38
+ dill==0.3.7
39
+ entrypoints==0.4
40
+ execnb==0.1.5
41
+ executing==0.8.3
42
+ fastai==2.7.12
43
+ fastapi==0.101.1
44
+ fastbook==0.0.29
45
+ fastcore==1.5.29
46
+ fastdownload==0.0.7
47
+ fastjsonschema==2.16.2
48
+ fastprogress==1.0.3
49
+ ffmpy==0.3.1
50
+ filelock==3.9.0
51
+ fonttools==4.42.0
52
+ frozenlist==1.4.0
53
+ fsspec==2023.6.0
54
+ ghapi==1.0.4
55
+ gmpy2==2.1.2
56
+ gradio==3.40.1
57
+ gradio_client==0.4.0
58
+ graphviz==0.20.1
59
+ h11==0.14.0
60
+ httpcore==0.17.3
61
+ httpx==0.24.1
62
+ huggingface-hub==0.16.4
63
+ idna==3.4
64
+ importlib-resources==6.0.1
65
+ ipykernel==6.25.0
66
+ ipython==8.12.2
67
+ ipython-genutils==0.2.0
68
+ ipywidgets==7.8.0
69
+ isodate==0.6.1
70
+ jedi==0.18.1
71
+ Jinja2==3.1.2
72
+ joblib==1.3.2
73
+ jsonschema==4.17.3
74
+ jupyter_client==7.4.9
75
+ jupyter_core==5.3.0
76
+ jupyter-server==1.23.4
77
+ jupyterlab-pygments==0.1.2
78
+ jupyterlab-widgets==1.1.5
79
+ kiwisolver==1.4.4
80
+ langcodes==3.3.0
81
+ linkify-it-py==2.0.2
82
+ lxml==4.9.2
83
+ markdown-it-py==2.2.0
84
+ MarkupSafe==2.1.1
85
+ matplotlib==3.7.2
86
+ matplotlib-inline==0.1.6
87
+ mdit-py-plugins==0.3.3
88
+ mdurl==0.1.2
89
+ mistune==0.8.4
90
+ mkl-fft==1.3.6
91
+ mkl-random==1.2.2
92
+ mkl-service==2.4.0
93
+ mpmath==1.3.0
94
+ msrest==0.7.1
95
+ msrestazure==0.6.4
96
+ multidict==6.0.4
97
+ multiprocess==0.70.15
98
+ murmurhash==1.0.9
99
+ nbclassic==0.5.5
100
+ nbclient==0.5.13
101
+ nbconvert==6.5.4
102
+ nbdev==2.3.12
103
+ nbformat==5.7.0
104
+ nest-asyncio==1.5.6
105
+ networkx==3.1
106
+ notebook==6.5.4
107
+ notebook_shim==0.2.2
108
+ numpy==1.25.2
109
+ oauthlib==3.2.2
110
+ orjson==3.9.5
111
+ packaging==23.1
112
+ pandas==2.0.3
113
+ pandocfilters==1.5.0
114
+ parso==0.8.3
115
+ pathy==0.10.2
116
+ pexpect==4.8.0
117
+ pickleshare==0.7.5
118
+ Pillow==9.4.0
119
+ pip==23.2.1
120
+ platformdirs==2.5.2
121
+ preshed==3.0.8
122
+ prometheus-client==0.14.1
123
+ prompt-toolkit==3.0.36
124
+ psutil==5.9.0
125
+ ptyprocess==0.7.0
126
+ pure-eval==0.2.2
127
+ pyarrow==12.0.1
128
+ pycparser==2.21
129
+ pydantic==2.1.1
130
+ pydantic_core==2.4.0
131
+ pydub==0.25.1
132
+ Pygments==2.15.1
133
+ PyJWT==2.8.0
134
+ pyOpenSSL==23.2.0
135
+ pyparsing==3.0.9
136
+ pyrsistent==0.18.0
137
+ PySocks==1.7.1
138
+ python-dateutil==2.8.2
139
+ python-multipart==0.0.6
140
+ pytz==2023.3
141
+ PyYAML==6.0.1
142
+ pyzmq==23.2.0
143
+ regex==2023.8.8
144
+ requests==2.31.0
145
+ requests-oauthlib==1.3.1
146
+ safetensors==0.3.2
147
+ scikit-learn==1.3.0
148
+ scipy==1.11.1
149
+ semantic-version==2.10.0
150
+ Send2Trash==1.8.0
151
+ sentencepiece==0.1.99
152
+ setuptools==68.0.0
153
+ six==1.16.0
154
+ smart-open==6.3.0
155
+ sniffio==1.2.0
156
+ soupsieve==2.4
157
+ spacy==3.6.1
158
+ spacy-legacy==3.0.12
159
+ spacy-loggers==1.0.4
160
+ srsly==2.4.7
161
+ stack-data==0.2.0
162
+ starlette==0.27.0
163
+ sympy==1.11.1
164
+ terminado==0.17.1
165
+ thinc==8.1.11
166
+ threadpoolctl==3.2.0
167
+ tinycss2==1.2.1
168
+ tokenizers==0.13.3
169
+ toolz==0.12.0
170
+ torch==2.0.1
171
+ torchvision==0.15.2
172
+ tornado==6.3.2
173
+ tqdm==4.66.1
174
+ traitlets==5.7.1
175
+ transformers==4.31.0
176
+ typer==0.9.0
177
+ typing_extensions==4.7.1
178
+ tzdata==2023.3
179
+ uc-micro-py==1.0.2
180
+ urllib3==1.26.16
181
+ uvicorn==0.23.2
182
+ wasabi==1.1.2
183
+ watchdog==3.0.0
184
+ wcwidth==0.2.6
185
+ webencodings==0.5.1
186
+ websocket-client==0.58.0
187
+ websockets==11.0.3
188
+ wheel==0.38.4
189
+ widgetsnbextension==3.6.5
190
+ xxhash==3.3.0
191
+ yarl==1.9.2
sample.png ADDED
sample2.png ADDED
sample3.png ADDED