riteshrm commited on
Commit
2b03290
·
1 Parent(s): d837277
Files changed (3) hide show
  1. app.py +27 -0
  2. model.pkl +3 -0
  3. requirements.txt +144 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AUTOGENERATED! DO NOT EDIT! File to edit: app.ipynb.
2
+
3
+ # %% auto 0
4
+ __all__ = ['learn', 'categories', 'image', 'label', 'intf', 'is_cat', 'classify_image']
5
+
6
+ # %% app.ipynb 1
7
+ from fastai.vision.all import *
8
+
9
+ # %% app.ipynb 3
10
+ def is_cat(x): return x[0].isupper()
11
+
12
+ # %% app.ipynb 6
13
+ learn = load_learner('model.pkl')
14
+
15
+ # %% app.ipynb 8
16
+ categories = ('Dog', 'Cat')
17
+
18
+ def classify_image(img):
19
+ pred, idx, probs =learn.predict(img)
20
+ return dict(zip(categories, map(float, probs)))
21
+
22
+ # %% app.ipynb 9
23
+ import gradio as gr
24
+ image = gr.components.Image(height=512, width= 512)
25
+ label = gr.components.Label()
26
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label).launch(share=False)
27
+ intf.launch(inline=False)
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce33552dc801b7dc0ad81ce303bbbea4b35bb2fdfbd509dd1761add24819427d
3
+ size 47061483
requirements.txt ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiofiles==23.2.1
2
+ altair==5.3.0
3
+ annotated-types==0.7.0
4
+ anyio==4.4.0
5
+ asttokens @ file:///home/conda/feedstock_root/build_artifacts/asttokens_1698341106958/work
6
+ astunparse==1.6.3
7
+ attrs==23.2.0
8
+ blis==0.7.11
9
+ Brotli @ file:///croot/brotli-split_1714483155106/work
10
+ catalogue==2.0.10
11
+ certifi @ file:///croot/certifi_1717618050233/work/certifi
12
+ charset-normalizer @ file:///tmp/build/80754af9/charset-normalizer_1630003229654/work
13
+ click==8.1.7
14
+ cloudpathlib==0.18.1
15
+ comm @ file:///home/conda/feedstock_root/build_artifacts/comm_1710320294760/work
16
+ confection==0.1.5
17
+ contourpy==1.2.1
18
+ cycler==0.12.1
19
+ cymem==2.0.8
20
+ debugpy @ file:///croot/debugpy_1690905042057/work
21
+ decorator @ file:///home/conda/feedstock_root/build_artifacts/decorator_1641555617451/work
22
+ dnspython==2.6.1
23
+ email_validator==2.2.0
24
+ entrypoints @ file:///home/conda/feedstock_root/build_artifacts/entrypoints_1643888246732/work
25
+ exceptiongroup @ file:///home/conda/feedstock_root/build_artifacts/exceptiongroup_1704921103267/work
26
+ execnb @ file:///home/jhoward/miniconda3/conda-bld/execnb_1714956396921/work
27
+ executing @ file:///home/conda/feedstock_root/build_artifacts/executing_1698579936712/work
28
+ fastai==2.7.15
29
+ fastapi==0.111.0
30
+ fastapi-cli==0.0.4
31
+ fastcore @ file:///Users/jhoward/miniconda3/conda-bld/fastcore_1719125228499/work
32
+ fastdownload==0.0.7
33
+ fastprogress==1.0.3
34
+ ffmpy==0.3.2
35
+ filelock @ file:///croot/filelock_1700591183607/work
36
+ fonttools==4.53.0
37
+ fsspec==2024.6.1
38
+ ghapi @ file:///home/jhoward/miniconda3/conda-bld/ghapi_1711823603258/work
39
+ gmpy2 @ file:///tmp/build/80754af9/gmpy2_1645455533097/work
40
+ gradio==4.37.2
41
+ gradio_client==1.0.2
42
+ h11==0.14.0
43
+ httpcore==1.0.5
44
+ httptools==0.6.1
45
+ httpx==0.27.0
46
+ huggingface-hub==0.23.4
47
+ idna @ file:///croot/idna_1714398848350/work
48
+ importlib_resources==6.4.0
49
+ ipykernel @ file:///home/conda/feedstock_root/build_artifacts/ipykernel_1719845459717/work
50
+ ipython @ file:///home/conda/feedstock_root/build_artifacts/ipython_1719582526268/work
51
+ jedi @ file:///home/conda/feedstock_root/build_artifacts/jedi_1696326070614/work
52
+ Jinja2 @ file:///croot/jinja2_1716993405101/work
53
+ joblib==1.4.2
54
+ jsonschema==4.22.0
55
+ jsonschema-specifications==2023.12.1
56
+ jupyter-client @ file:///home/conda/feedstock_root/build_artifacts/jupyter_client_1654730843242/work
57
+ jupyter_core @ file:///home/conda/feedstock_root/build_artifacts/jupyter_core_1710257277185/work
58
+ kiwisolver==1.4.5
59
+ langcodes==3.4.0
60
+ language_data==1.2.0
61
+ marisa-trie==1.2.0
62
+ markdown-it-py==3.0.0
63
+ MarkupSafe @ file:///croot/markupsafe_1704205993651/work
64
+ matplotlib==3.9.0
65
+ matplotlib-inline @ file:///home/conda/feedstock_root/build_artifacts/matplotlib-inline_1713250518406/work
66
+ mdurl==0.1.2
67
+ mkl-fft @ file:///croot/mkl_fft_1695058164594/work
68
+ mkl-random @ file:///croot/mkl_random_1695059800811/work
69
+ mkl-service==2.4.0
70
+ mpmath @ file:///croot/mpmath_1690848262763/work
71
+ murmurhash==1.0.10
72
+ nbdev @ file:///Users/jhoward/miniconda3/conda-bld/nbdev_1717303230880/work
73
+ nest_asyncio @ file:///home/conda/feedstock_root/build_artifacts/nest-asyncio_1705850609492/work
74
+ networkx @ file:///croot/networkx_1720002482208/work
75
+ numpy @ file:///croot/numpy_and_numpy_base_1708638617955/work/dist/numpy-1.26.4-cp310-cp310-linux_x86_64.whl#sha256=d8cd837ed43e87f77e6efaa08e8de927ca030a1c9c5d04624432d6fb9a74a5ee
76
+ orjson==3.10.6
77
+ packaging @ file:///home/conda/feedstock_root/build_artifacts/packaging_1718189413536/work
78
+ pandas==2.2.2
79
+ parso @ file:///home/conda/feedstock_root/build_artifacts/parso_1712320355065/work
80
+ pexpect @ file:///home/conda/feedstock_root/build_artifacts/pexpect_1706113125309/work
81
+ pickleshare @ file:///home/conda/feedstock_root/build_artifacts/pickleshare_1602536217715/work
82
+ pillow @ file:///croot/pillow_1714398848491/work
83
+ platformdirs @ file:///home/conda/feedstock_root/build_artifacts/platformdirs_1715777629804/work
84
+ preshed==3.0.9
85
+ prompt_toolkit @ file:///home/conda/feedstock_root/build_artifacts/prompt-toolkit_1718047967974/work
86
+ psutil @ file:///opt/conda/conda-bld/psutil_1656431268089/work
87
+ ptyprocess @ file:///home/conda/feedstock_root/build_artifacts/ptyprocess_1609419310487/work/dist/ptyprocess-0.7.0-py2.py3-none-any.whl
88
+ pure-eval @ file:///home/conda/feedstock_root/build_artifacts/pure_eval_1642875951954/work
89
+ pydantic==2.8.1
90
+ pydantic_core==2.20.1
91
+ pydub==0.25.1
92
+ Pygments @ file:///home/conda/feedstock_root/build_artifacts/pygments_1714846767233/work
93
+ pyparsing==3.1.2
94
+ PySocks @ file:///home/builder/ci_310/pysocks_1640793678128/work
95
+ python-dateutil @ file:///home/conda/feedstock_root/build_artifacts/python-dateutil_1709299778482/work
96
+ python-dotenv==1.0.1
97
+ python-multipart==0.0.9
98
+ pytz==2024.1
99
+ PyYAML @ file:///croot/pyyaml_1698096049011/work
100
+ pyzmq @ file:///croot/pyzmq_1705605076900/work
101
+ referencing==0.35.1
102
+ requests @ file:///croot/requests_1716902831423/work
103
+ rich==13.7.1
104
+ rpds-py==0.18.1
105
+ ruff==0.5.0
106
+ scikit-learn==1.5.1
107
+ scipy==1.14.0
108
+ semantic-version==2.10.0
109
+ shellingham==1.5.4
110
+ six @ file:///home/conda/feedstock_root/build_artifacts/six_1620240208055/work
111
+ smart-open==7.0.4
112
+ sniffio==1.3.1
113
+ spacy==3.7.5
114
+ spacy-legacy==3.0.12
115
+ spacy-loggers==1.0.5
116
+ srsly==2.4.8
117
+ stack-data @ file:///home/conda/feedstock_root/build_artifacts/stack_data_1669632077133/work
118
+ starlette==0.37.2
119
+ sympy @ file:///croot/sympy_1701397643339/work
120
+ thinc==8.2.5
121
+ threadpoolctl==3.5.0
122
+ tomlkit==0.12.0
123
+ toolz==0.12.1
124
+ torch==2.3.1
125
+ torchaudio==2.3.1
126
+ torchvision==0.18.1
127
+ tornado @ file:///home/conda/feedstock_root/build_artifacts/tornado_1648827254365/work
128
+ tqdm==4.66.4
129
+ traitlets @ file:///home/conda/feedstock_root/build_artifacts/traitlets_1713535121073/work
130
+ triton==2.3.1
131
+ typer==0.12.3
132
+ typing_extensions @ file:///home/conda/feedstock_root/build_artifacts/typing_extensions_1717802530399/work
133
+ tzdata==2024.1
134
+ ujson==5.10.0
135
+ urllib3 @ file:///croot/urllib3_1718912636303/work
136
+ uvicorn==0.30.1
137
+ uvloop==0.19.0
138
+ wasabi==1.1.3
139
+ watchdog @ file:///croot/watchdog_1717166512516/work
140
+ watchfiles==0.22.0
141
+ wcwidth @ file:///home/conda/feedstock_root/build_artifacts/wcwidth_1704731205417/work
142
+ weasel==0.4.1
143
+ websockets==11.0.3
144
+ wrapt==1.16.0