AgastyaPatel
commited on
Commit
Β·
a71e6ad
1
Parent(s):
3128f39
fixed untracable paths
Browse files
02_BearClassifierDeployment.ipynb
CHANGED
@@ -2,15 +2,195 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {
|
7 |
"colab": {
|
8 |
"base_uri": "https://localhost:8080/"
|
9 |
},
|
|
|
10 |
"id": "GAEn7ZfhcSLC",
|
11 |
-
"outputId": "0eb4e49b-e0bc-41ab-f75a-d404141a1191"
|
|
|
|
|
|
|
|
|
12 |
},
|
13 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
"source": [
|
15 |
"!pip install gradio nbdev"
|
16 |
]
|
@@ -152,20 +332,30 @@
|
|
152 |
"cell_type": "code",
|
153 |
"execution_count": 8,
|
154 |
"metadata": {
|
155 |
-
"
|
|
|
|
|
|
|
|
|
|
|
156 |
},
|
157 |
"outputs": [],
|
158 |
"source": [
|
159 |
"#|export\n",
|
160 |
"# creating inference\n",
|
161 |
-
"learn = load_learner('
|
162 |
]
|
163 |
},
|
164 |
{
|
165 |
"cell_type": "code",
|
166 |
"execution_count": 9,
|
167 |
"metadata": {
|
168 |
-
"
|
|
|
|
|
|
|
|
|
|
|
169 |
},
|
170 |
"outputs": [],
|
171 |
"source": [
|
@@ -185,8 +375,13 @@
|
|
185 |
"base_uri": "https://localhost:8080/",
|
186 |
"height": 646
|
187 |
},
|
|
|
188 |
"id": "jLrBazuoddxB",
|
189 |
-
"outputId": "7665b29e-7489-469f-ac00-dbd90d9bbe0c"
|
|
|
|
|
|
|
|
|
190 |
},
|
191 |
"outputs": [
|
192 |
{
|
@@ -219,7 +414,7 @@
|
|
219 |
"# gradio interface Setup\n",
|
220 |
"image = gr.Image()\n",
|
221 |
"label = gr.Label()\n",
|
222 |
-
"examples = ['
|
223 |
"\n",
|
224 |
"intf = gr.Interface(fn = classify_image, inputs = image, outputs = label, examples = examples).launch()"
|
225 |
]
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 4,
|
6 |
"metadata": {
|
7 |
"colab": {
|
8 |
"base_uri": "https://localhost:8080/"
|
9 |
},
|
10 |
+
"editable": true,
|
11 |
"id": "GAEn7ZfhcSLC",
|
12 |
+
"outputId": "0eb4e49b-e0bc-41ab-f75a-d404141a1191",
|
13 |
+
"slideshow": {
|
14 |
+
"slide_type": ""
|
15 |
+
},
|
16 |
+
"tags": []
|
17 |
},
|
18 |
+
"outputs": [
|
19 |
+
{
|
20 |
+
"name": "stdout",
|
21 |
+
"output_type": "stream",
|
22 |
+
"text": [
|
23 |
+
"Collecting gradio\n",
|
24 |
+
" Obtaining dependency information for gradio from https://files.pythonhosted.org/packages/d8/3c/fcfa9f2f9b97e9c38ccb30eb3edef8acbb284487bc7d8f5b98daf01cf757/gradio-4.12.0-py3-none-any.whl.metadata\n",
|
25 |
+
" Downloading gradio-4.12.0-py3-none-any.whl.metadata (15 kB)\n",
|
26 |
+
"Requirement already satisfied: nbdev in /home/agastya/miniforge3/lib/python3.10/site-packages (2.3.13)\n",
|
27 |
+
"Collecting aiofiles<24.0,>=22.0 (from gradio)\n",
|
28 |
+
" Obtaining dependency information for aiofiles<24.0,>=22.0 from https://files.pythonhosted.org/packages/c5/19/5af6804c4cc0fed83f47bff6e413a98a36618e7d40185cd36e69737f3b0e/aiofiles-23.2.1-py3-none-any.whl.metadata\n",
|
29 |
+
" Downloading aiofiles-23.2.1-py3-none-any.whl.metadata (9.7 kB)\n",
|
30 |
+
"Collecting altair<6.0,>=4.2.0 (from gradio)\n",
|
31 |
+
" Obtaining dependency information for altair<6.0,>=4.2.0 from https://files.pythonhosted.org/packages/c5/e4/7fcceef127badbb0d644d730d992410e4f3799b295c9964a172f92a469c7/altair-5.2.0-py3-none-any.whl.metadata\n",
|
32 |
+
" Downloading altair-5.2.0-py3-none-any.whl.metadata (8.7 kB)\n",
|
33 |
+
"Collecting fastapi (from gradio)\n",
|
34 |
+
" Obtaining dependency information for fastapi from https://files.pythonhosted.org/packages/d4/e0/d5d6482e992a1892f3a9a62f6a9154944ae5b276e7da1cf92faa02e3a107/fastapi-0.108.0-py3-none-any.whl.metadata\n",
|
35 |
+
" Downloading fastapi-0.108.0-py3-none-any.whl.metadata (24 kB)\n",
|
36 |
+
"Collecting ffmpy (from gradio)\n",
|
37 |
+
" Downloading ffmpy-0.3.1.tar.gz (5.5 kB)\n",
|
38 |
+
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
|
39 |
+
"\u001b[?25hCollecting gradio-client==0.8.0 (from gradio)\n",
|
40 |
+
" Obtaining dependency information for gradio-client==0.8.0 from https://files.pythonhosted.org/packages/c4/e7/5da3a4b6108f5e2e43d034d7923c3562f93beba8f3d13a0ec7c201a6f33c/gradio_client-0.8.0-py3-none-any.whl.metadata\n",
|
41 |
+
" Downloading gradio_client-0.8.0-py3-none-any.whl.metadata (7.1 kB)\n",
|
42 |
+
"Collecting httpx (from gradio)\n",
|
43 |
+
" Obtaining dependency information for httpx from https://files.pythonhosted.org/packages/39/9b/4937d841aee9c2c8102d9a4eeb800c7dad25386caabb4a1bf5010df81a57/httpx-0.26.0-py3-none-any.whl.metadata\n",
|
44 |
+
" Downloading httpx-0.26.0-py3-none-any.whl.metadata (7.6 kB)\n",
|
45 |
+
"Collecting huggingface-hub>=0.19.3 (from gradio)\n",
|
46 |
+
" Obtaining dependency information for huggingface-hub>=0.19.3 from https://files.pythonhosted.org/packages/a0/0a/02ac0ae1047d97769003ff4fb8e6717024f3f174a5d13257415aa09e13d9/huggingface_hub-0.20.1-py3-none-any.whl.metadata\n",
|
47 |
+
" Downloading huggingface_hub-0.20.1-py3-none-any.whl.metadata (12 kB)\n",
|
48 |
+
"Requirement already satisfied: importlib-resources<7.0,>=1.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (6.1.1)\n",
|
49 |
+
"Requirement already satisfied: jinja2<4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (3.1.2)\n",
|
50 |
+
"Requirement already satisfied: markupsafe~=2.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (2.1.3)\n",
|
51 |
+
"Requirement already satisfied: matplotlib~=3.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (3.8.0)\n",
|
52 |
+
"Requirement already satisfied: numpy~=1.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (1.26.2)\n",
|
53 |
+
"Collecting orjson~=3.0 (from gradio)\n",
|
54 |
+
" Obtaining dependency information for orjson~=3.0 from https://files.pythonhosted.org/packages/17/e2/7ff96963ba854f0a807fd2783bd7d947ecb0cac7df1d802699727c418aec/orjson-3.9.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata\n",
|
55 |
+
" Downloading orjson-3.9.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (49 kB)\n",
|
56 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m49.3/49.3 kB\u001b[0m \u001b[31m2.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
57 |
+
"\u001b[?25hRequirement already satisfied: packaging in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (23.1)\n",
|
58 |
+
"Requirement already satisfied: pandas<3.0,>=1.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (2.1.4)\n",
|
59 |
+
"Requirement already satisfied: pillow<11.0,>=8.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (9.4.0)\n",
|
60 |
+
"Requirement already satisfied: pydantic>=2.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (2.5.3)\n",
|
61 |
+
"Collecting pydub (from gradio)\n",
|
62 |
+
" Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
|
63 |
+
"Collecting python-multipart (from gradio)\n",
|
64 |
+
" Downloading python_multipart-0.0.6-py3-none-any.whl (45 kB)\n",
|
65 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m6.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
66 |
+
"\u001b[?25hRequirement already satisfied: pyyaml<7.0,>=5.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (6.0.1)\n",
|
67 |
+
"Collecting semantic-version~=2.0 (from gradio)\n",
|
68 |
+
" Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n",
|
69 |
+
"Collecting tomlkit==0.12.0 (from gradio)\n",
|
70 |
+
" Obtaining dependency information for tomlkit==0.12.0 from https://files.pythonhosted.org/packages/68/4f/12207897848a653d03ebbf6775a29d949408ded5f99b2d87198bc5c93508/tomlkit-0.12.0-py3-none-any.whl.metadata\n",
|
71 |
+
" Downloading tomlkit-0.12.0-py3-none-any.whl.metadata (2.7 kB)\n",
|
72 |
+
"Requirement already satisfied: typer[all]<1.0,>=0.9 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (0.9.0)\n",
|
73 |
+
"Requirement already satisfied: typing-extensions~=4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from gradio) (4.9.0)\n",
|
74 |
+
"Collecting uvicorn>=0.14.0 (from gradio)\n",
|
75 |
+
" Obtaining dependency information for uvicorn>=0.14.0 from https://files.pythonhosted.org/packages/26/59/fddd9df489fe27f492cc97626e03663fb3b9b6ef7ce8597a7cdc5f2cbbad/uvicorn-0.25.0-py3-none-any.whl.metadata\n",
|
76 |
+
" Downloading uvicorn-0.25.0-py3-none-any.whl.metadata (6.4 kB)\n",
|
77 |
+
"Collecting fsspec (from gradio-client==0.8.0->gradio)\n",
|
78 |
+
" Obtaining dependency information for fsspec from https://files.pythonhosted.org/packages/70/25/fab23259a52ece5670dcb8452e1af34b89e6135ecc17cd4b54b4b479eac6/fsspec-2023.12.2-py3-none-any.whl.metadata\n",
|
79 |
+
" Downloading fsspec-2023.12.2-py3-none-any.whl.metadata (6.8 kB)\n",
|
80 |
+
"Collecting websockets<12.0,>=10.0 (from gradio-client==0.8.0->gradio)\n",
|
81 |
+
" Downloading websockets-11.0.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (129 kB)\n",
|
82 |
+
"\u001b[2K \u001b[90mβββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
83 |
+
"\u001b[?25hRequirement already satisfied: ipywidgets<=8.0.4 in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (8.0.4)\n",
|
84 |
+
"Requirement already satisfied: fastcore>=1.5.27 in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (1.5.29)\n",
|
85 |
+
"Requirement already satisfied: execnb>=0.1.4 in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (0.1.5)\n",
|
86 |
+
"Requirement already satisfied: astunparse in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (1.6.3)\n",
|
87 |
+
"Requirement already satisfied: ghapi>=1.0.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (1.0.4)\n",
|
88 |
+
"Requirement already satisfied: watchdog in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (3.0.0)\n",
|
89 |
+
"Requirement already satisfied: asttokens in /home/agastya/miniforge3/lib/python3.10/site-packages (from nbdev) (2.4.1)\n",
|
90 |
+
"Requirement already satisfied: jsonschema>=3.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (4.20.0)\n",
|
91 |
+
"Requirement already satisfied: toolz in /home/agastya/miniforge3/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.0)\n",
|
92 |
+
"Requirement already satisfied: ipython in /home/agastya/miniforge3/lib/python3.10/site-packages (from execnb>=0.1.4->nbdev) (8.19.0)\n",
|
93 |
+
"Requirement already satisfied: pip in /home/agastya/miniforge3/lib/python3.10/site-packages (from fastcore>=1.5.27->nbdev) (23.2.1)\n",
|
94 |
+
"Requirement already satisfied: filelock in /home/agastya/miniforge3/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (3.13.1)\n",
|
95 |
+
"Requirement already satisfied: requests in /home/agastya/miniforge3/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (2.31.0)\n",
|
96 |
+
"Requirement already satisfied: tqdm>=4.42.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (4.66.1)\n",
|
97 |
+
"Requirement already satisfied: ipykernel>=4.5.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (6.26.0)\n",
|
98 |
+
"Requirement already satisfied: traitlets>=4.3.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (5.14.0)\n",
|
99 |
+
"Requirement already satisfied: widgetsnbextension~=4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (4.0.9)\n",
|
100 |
+
"Requirement already satisfied: jupyterlab-widgets~=3.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipywidgets<=8.0.4->nbdev) (3.0.9)\n",
|
101 |
+
"Requirement already satisfied: contourpy>=1.0.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.2.0)\n",
|
102 |
+
"Requirement already satisfied: cycler>=0.10 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (0.12.1)\n",
|
103 |
+
"Requirement already satisfied: fonttools>=4.22.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (4.47.0)\n",
|
104 |
+
"Requirement already satisfied: kiwisolver>=1.0.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\n",
|
105 |
+
"Requirement already satisfied: pyparsing>=2.3.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (3.1.1)\n",
|
106 |
+
"Requirement already satisfied: python-dateutil>=2.7 in /home/agastya/miniforge3/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (2.8.2)\n",
|
107 |
+
"Requirement already satisfied: pytz>=2020.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3.post1)\n",
|
108 |
+
"Requirement already satisfied: tzdata>=2022.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3)\n",
|
109 |
+
"Requirement already satisfied: annotated-types>=0.4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (0.6.0)\n",
|
110 |
+
"Requirement already satisfied: pydantic-core==2.14.6 in /home/agastya/miniforge3/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (2.14.6)\n",
|
111 |
+
"Requirement already satisfied: click<9.0.0,>=7.1.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (8.1.7)\n",
|
112 |
+
"Requirement already satisfied: colorama<0.5.0,>=0.4.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (0.4.6)\n",
|
113 |
+
"Requirement already satisfied: shellingham<2.0.0,>=1.3.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (1.5.4)\n",
|
114 |
+
"Requirement already satisfied: rich<14.0.0,>=10.11.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (13.7.0)\n",
|
115 |
+
"Collecting h11>=0.8 (from uvicorn>=0.14.0->gradio)\n",
|
116 |
+
" Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n",
|
117 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m6.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
118 |
+
"\u001b[?25hRequirement already satisfied: six>=1.12.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from asttokens->nbdev) (1.16.0)\n",
|
119 |
+
"Requirement already satisfied: wheel<1.0,>=0.23.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from astunparse->nbdev) (0.41.2)\n",
|
120 |
+
"Collecting starlette<0.33.0,>=0.29.0 (from fastapi->gradio)\n",
|
121 |
+
" Obtaining dependency information for starlette<0.33.0,>=0.29.0 from https://files.pythonhosted.org/packages/40/9e/6bfa6be40034fa04cc50e2a81d24a4e5b89279c688b51380d70ac31c0556/starlette-0.32.0.post1-py3-none-any.whl.metadata\n",
|
122 |
+
" Downloading starlette-0.32.0.post1-py3-none-any.whl.metadata (5.8 kB)\n",
|
123 |
+
"Requirement already satisfied: anyio in /home/agastya/miniforge3/lib/python3.10/site-packages (from httpx->gradio) (4.2.0)\n",
|
124 |
+
"Requirement already satisfied: certifi in /home/agastya/miniforge3/lib/python3.10/site-packages (from httpx->gradio) (2023.11.17)\n",
|
125 |
+
"Collecting httpcore==1.* (from httpx->gradio)\n",
|
126 |
+
" Obtaining dependency information for httpcore==1.* from https://files.pythonhosted.org/packages/56/ba/78b0a99c4da0ff8b0f59defa2f13ca4668189b134bd9840b6202a93d9a0f/httpcore-1.0.2-py3-none-any.whl.metadata\n",
|
127 |
+
" Downloading httpcore-1.0.2-py3-none-any.whl.metadata (20 kB)\n",
|
128 |
+
"Requirement already satisfied: idna in /home/agastya/miniforge3/lib/python3.10/site-packages (from httpx->gradio) (3.4)\n",
|
129 |
+
"Requirement already satisfied: sniffio in /home/agastya/miniforge3/lib/python3.10/site-packages (from httpx->gradio) (1.3.0)\n",
|
130 |
+
"Requirement already satisfied: comm>=0.1.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (0.1.4)\n",
|
131 |
+
"Requirement already satisfied: debugpy>=1.6.5 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (1.8.0)\n",
|
132 |
+
"Requirement already satisfied: jupyter-client>=6.1.12 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (8.6.0)\n",
|
133 |
+
"Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (5.5.1)\n",
|
134 |
+
"Requirement already satisfied: matplotlib-inline>=0.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (0.1.6)\n",
|
135 |
+
"Requirement already satisfied: nest-asyncio in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (1.5.8)\n",
|
136 |
+
"Requirement already satisfied: psutil in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (5.9.7)\n",
|
137 |
+
"Requirement already satisfied: pyzmq>=20 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (25.1.2)\n",
|
138 |
+
"Requirement already satisfied: tornado>=6.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (6.3.3)\n",
|
139 |
+
"Requirement already satisfied: decorator in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (5.1.1)\n",
|
140 |
+
"Requirement already satisfied: jedi>=0.16 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (0.19.1)\n",
|
141 |
+
"Requirement already satisfied: prompt-toolkit<3.1.0,>=3.0.41 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (3.0.42)\n",
|
142 |
+
"Requirement already satisfied: pygments>=2.4.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (2.17.2)\n",
|
143 |
+
"Requirement already satisfied: stack-data in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (0.6.2)\n",
|
144 |
+
"Requirement already satisfied: exceptiongroup in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (1.2.0)\n",
|
145 |
+
"Requirement already satisfied: pexpect>4.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from ipython->execnb>=0.1.4->nbdev) (4.8.0)\n",
|
146 |
+
"Requirement already satisfied: attrs>=22.2.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.1.0)\n",
|
147 |
+
"Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.11.2)\n",
|
148 |
+
"Requirement already satisfied: referencing>=0.28.4 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.32.0)\n",
|
149 |
+
"Requirement already satisfied: rpds-py>=0.7.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.15.2)\n",
|
150 |
+
"Requirement already satisfied: markdown-it-py>=2.2.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (3.0.0)\n",
|
151 |
+
"Requirement already satisfied: charset-normalizer<4,>=2 in /home/agastya/miniforge3/lib/python3.10/site-packages (from requests->huggingface-hub>=0.19.3->gradio) (3.2.0)\n",
|
152 |
+
"Requirement already satisfied: urllib3<3,>=1.21.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from requests->huggingface-hub>=0.19.3->gradio) (2.0.4)\n",
|
153 |
+
"Requirement already satisfied: parso<0.9.0,>=0.8.3 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jedi>=0.16->ipython->execnb>=0.1.4->nbdev) (0.8.3)\n",
|
154 |
+
"Requirement already satisfied: platformdirs>=2.5 in /home/agastya/miniforge3/lib/python3.10/site-packages (from jupyter-core!=5.0.*,>=4.12->ipykernel>=4.5.1->ipywidgets<=8.0.4->nbdev) (4.1.0)\n",
|
155 |
+
"Requirement already satisfied: mdurl~=0.1 in /home/agastya/miniforge3/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (0.1.0)\n",
|
156 |
+
"Requirement already satisfied: ptyprocess>=0.5 in /home/agastya/miniforge3/lib/python3.10/site-packages (from pexpect>4.3->ipython->execnb>=0.1.4->nbdev) (0.7.0)\n",
|
157 |
+
"Requirement already satisfied: wcwidth in /home/agastya/miniforge3/lib/python3.10/site-packages (from prompt-toolkit<3.1.0,>=3.0.41->ipython->execnb>=0.1.4->nbdev) (0.2.12)\n",
|
158 |
+
"Requirement already satisfied: executing>=1.2.0 in /home/agastya/miniforge3/lib/python3.10/site-packages (from stack-data->ipython->execnb>=0.1.4->nbdev) (2.0.1)\n",
|
159 |
+
"Requirement already satisfied: pure-eval in /home/agastya/miniforge3/lib/python3.10/site-packages (from stack-data->ipython->execnb>=0.1.4->nbdev) (0.2.2)\n",
|
160 |
+
"Downloading gradio-4.12.0-py3-none-any.whl (16.6 MB)\n",
|
161 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m16.6/16.6 MB\u001b[0m \u001b[31m5.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
162 |
+
"\u001b[?25hDownloading gradio_client-0.8.0-py3-none-any.whl (305 kB)\n",
|
163 |
+
"\u001b[2K \u001b[90mββββββββββοΏ½οΏ½οΏ½βββββββββββββββββββββββββββββ\u001b[0m \u001b[32m305.1/305.1 kB\u001b[0m \u001b[31m6.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
164 |
+
"\u001b[?25hDownloading tomlkit-0.12.0-py3-none-any.whl (37 kB)\n",
|
165 |
+
"Downloading aiofiles-23.2.1-py3-none-any.whl (15 kB)\n",
|
166 |
+
"Downloading altair-5.2.0-py3-none-any.whl (996 kB)\n",
|
167 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m996.9/996.9 kB\u001b[0m \u001b[31m6.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
168 |
+
"\u001b[?25hDownloading huggingface_hub-0.20.1-py3-none-any.whl (330 kB)\n",
|
169 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m330.1/330.1 kB\u001b[0m \u001b[31m6.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
170 |
+
"\u001b[?25hDownloading orjson-3.9.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138 kB)\n",
|
171 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m138.7/138.7 kB\u001b[0m \u001b[31m7.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
172 |
+
"\u001b[?25hDownloading uvicorn-0.25.0-py3-none-any.whl (60 kB)\n",
|
173 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m60.3/60.3 kB\u001b[0m \u001b[31m6.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
174 |
+
"\u001b[?25hDownloading fastapi-0.108.0-py3-none-any.whl (92 kB)\n",
|
175 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m92.0/92.0 kB\u001b[0m \u001b[31m5.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
176 |
+
"\u001b[?25hDownloading httpx-0.26.0-py3-none-any.whl (75 kB)\n",
|
177 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m75.9/75.9 kB\u001b[0m \u001b[31m5.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
178 |
+
"\u001b[?25hDownloading httpcore-1.0.2-py3-none-any.whl (76 kB)\n",
|
179 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m76.9/76.9 kB\u001b[0m \u001b[31m7.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
180 |
+
"\u001b[?25hDownloading fsspec-2023.12.2-py3-none-any.whl (168 kB)\n",
|
181 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m169.0/169.0 kB\u001b[0m \u001b[31m7.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
182 |
+
"\u001b[?25hDownloading starlette-0.32.0.post1-py3-none-any.whl (70 kB)\n",
|
183 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m70.0/70.0 kB\u001b[0m \u001b[31m6.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
184 |
+
"\u001b[?25hBuilding wheels for collected packages: ffmpy\n",
|
185 |
+
" Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n",
|
186 |
+
"\u001b[?25h Created wheel for ffmpy: filename=ffmpy-0.3.1-py3-none-any.whl size=5579 sha256=795f3c4dd1d184ba6162b37602d4e538cac01d79ee2a96270555a769e029a0ec\n",
|
187 |
+
" Stored in directory: /home/agastya/.cache/pip/wheels/01/a6/d1/1c0828c304a4283b2c1639a09ad86f83d7c487ef34c6b4a1bf\n",
|
188 |
+
"Successfully built ffmpy\n",
|
189 |
+
"Installing collected packages: pydub, ffmpy, websockets, tomlkit, semantic-version, python-multipart, orjson, h11, fsspec, aiofiles, uvicorn, starlette, huggingface-hub, httpcore, httpx, fastapi, gradio-client, altair, gradio\n",
|
190 |
+
"Successfully installed aiofiles-23.2.1 altair-5.2.0 fastapi-0.108.0 ffmpy-0.3.1 fsspec-2023.12.2 gradio-4.12.0 gradio-client-0.8.0 h11-0.14.0 httpcore-1.0.2 httpx-0.26.0 huggingface-hub-0.20.1 orjson-3.9.10 pydub-0.25.1 python-multipart-0.0.6 semantic-version-2.10.0 starlette-0.32.0.post1 tomlkit-0.12.0 uvicorn-0.25.0 websockets-11.0.3\n"
|
191 |
+
]
|
192 |
+
}
|
193 |
+
],
|
194 |
"source": [
|
195 |
"!pip install gradio nbdev"
|
196 |
]
|
|
|
332 |
"cell_type": "code",
|
333 |
"execution_count": 8,
|
334 |
"metadata": {
|
335 |
+
"editable": true,
|
336 |
+
"id": "nc2O48TScW_7",
|
337 |
+
"slideshow": {
|
338 |
+
"slide_type": ""
|
339 |
+
},
|
340 |
+
"tags": []
|
341 |
},
|
342 |
"outputs": [],
|
343 |
"source": [
|
344 |
"#|export\n",
|
345 |
"# creating inference\n",
|
346 |
+
"learn = load_learner('content/bearClassifier.pkl')"
|
347 |
]
|
348 |
},
|
349 |
{
|
350 |
"cell_type": "code",
|
351 |
"execution_count": 9,
|
352 |
"metadata": {
|
353 |
+
"editable": true,
|
354 |
+
"id": "dGC3UmI4c3QY",
|
355 |
+
"slideshow": {
|
356 |
+
"slide_type": ""
|
357 |
+
},
|
358 |
+
"tags": []
|
359 |
},
|
360 |
"outputs": [],
|
361 |
"source": [
|
|
|
375 |
"base_uri": "https://localhost:8080/",
|
376 |
"height": 646
|
377 |
},
|
378 |
+
"editable": true,
|
379 |
"id": "jLrBazuoddxB",
|
380 |
+
"outputId": "7665b29e-7489-469f-ac00-dbd90d9bbe0c",
|
381 |
+
"slideshow": {
|
382 |
+
"slide_type": ""
|
383 |
+
},
|
384 |
+
"tags": []
|
385 |
},
|
386 |
"outputs": [
|
387 |
{
|
|
|
414 |
"# gradio interface Setup\n",
|
415 |
"image = gr.Image()\n",
|
416 |
"label = gr.Label()\n",
|
417 |
+
"examples = ['content/bear1.jpg', 'content/bear2.jpg', 'content/bear3.jpg', 'content/bear4.jpg']\n",
|
418 |
"\n",
|
419 |
"intf = gr.Interface(fn = classify_image, inputs = image, outputs = label, examples = examples).launch()"
|
420 |
]
|
app.py
CHANGED
@@ -10,7 +10,7 @@ import gradio as gr
|
|
10 |
|
11 |
# %% 02_BearClassifierDeployment.ipynb 5
|
12 |
# creating inference
|
13 |
-
learn = load_learner('
|
14 |
|
15 |
# %% 02_BearClassifierDeployment.ipynb 6
|
16 |
categories = ('Black', 'Grizzly', 'Teddy')
|
@@ -23,6 +23,6 @@ def classify_image(img):
|
|
23 |
# gradio interface Setup
|
24 |
image = gr.Image()
|
25 |
label = gr.Label()
|
26 |
-
examples = ['
|
27 |
|
28 |
intf = gr.Interface(fn = classify_image, inputs = image, outputs = label, examples = examples).launch()
|
|
|
10 |
|
11 |
# %% 02_BearClassifierDeployment.ipynb 5
|
12 |
# creating inference
|
13 |
+
learn = load_learner('content/bearClassifier.pkl')
|
14 |
|
15 |
# %% 02_BearClassifierDeployment.ipynb 6
|
16 |
categories = ('Black', 'Grizzly', 'Teddy')
|
|
|
23 |
# gradio interface Setup
|
24 |
image = gr.Image()
|
25 |
label = gr.Label()
|
26 |
+
examples = ['content/bear1.jpg', 'content/bear2.jpg', 'content/bear3.jpg', 'content/bear4.jpg']
|
27 |
|
28 |
intf = gr.Interface(fn = classify_image, inputs = image, outputs = label, examples = examples).launch()
|
content/bear1.jpgοΊZone.Identifier
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
[ZoneTransfer]
|
2 |
-
ZoneId=3
|
3 |
-
ReferrerUrl=https://www.google.com/
|
4 |
-
HostUrl=https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQOJd_2nLmMzF0BmSWyqdCIOw1BikaDZcmXdg&usqp=CAU
|
|
|
|
|
|
|
|
|
|
content/bear2.jpgοΊZone.Identifier
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
[ZoneTransfer]
|
2 |
-
ZoneId=3
|
3 |
-
ReferrerUrl=https://www.google.com/
|
4 |
-
HostUrl=https://files.worldwildlife.org/wwfcmsprod/images/Brown_Bear_/story_full_width/3box0qwlkk_brownbear_hero.jpg
|
|
|
|
|
|
|
|
|
|
content/bear3.jpgοΊZone.Identifier
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
[ZoneTransfer]
|
2 |
-
ZoneId=3
|
3 |
-
ReferrerUrl=https://www.google.com/
|
4 |
-
HostUrl=https://i.pinimg.com/1200x/33/cb/fe/33cbfe9d3fa1d433c0972e8e983b9814.jpg
|
|
|
|
|
|
|
|
|
|
content/bear4.jpgοΊZone.Identifier
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
[ZoneTransfer]
|
2 |
-
ZoneId=3
|
3 |
-
ReferrerUrl=https://www.google.com/
|
4 |
-
HostUrl=https://www.google.com/
|
|
|
|
|
|
|
|
|
|