root commited on
Commit
e6faf6c
·
1 Parent(s): 81366e8

added my model to interface

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ export.pkl filter=lfs diff=lfs merge=lfs -text
.ipynb_checkpoints/app-checkpoint.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def greet(name):
4
+ return "Hello " + name + "!!"
5
+
6
+ iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
+ iface.launch()
.ipynb_checkpoints/testing-checkpoint.ipynb CHANGED
@@ -2,7 +2,7 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 4,
6
  "id": "c31ed028-ddf3-4c13-8049-1b67bf184a98",
7
  "metadata": {},
8
  "outputs": [
@@ -31,59 +31,59 @@
31
  "Collecting httpx (from gradio)\n",
32
  " Obtaining dependency information for httpx from https://files.pythonhosted.org/packages/33/0d/d9ce469af019741c8999711d36b270ff992ceb1a0293f73f9f34fdf131e9/httpx-0.25.0-py3-none-any.whl.metadata\n",
33
  " Downloading httpx-0.25.0-py3-none-any.whl.metadata (7.6 kB)\n",
34
- "Requirement already satisfied: huggingface-hub>=0.14.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (0.17.3)\n",
35
- "Requirement already satisfied: importlib-resources<7.0,>=1.3 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (6.1.0)\n",
36
- "Requirement already satisfied: jinja2<4.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (3.1.2)\n",
37
- "Requirement already satisfied: markupsafe~=2.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (2.1.3)\n",
38
- "Requirement already satisfied: matplotlib~=3.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (3.8.0)\n",
39
- "Requirement already satisfied: numpy~=1.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (1.26.0)\n",
40
  "Collecting orjson~=3.0 (from gradio)\n",
41
  " Obtaining dependency information for orjson~=3.0 from https://files.pythonhosted.org/packages/f4/66/d13cb488f5e74d603ebeb0b7b5032a81462d76d0b197a7b2002843ca1055/orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata\n",
42
  " Downloading orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (49 kB)\n",
43
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.3/49.3 kB\u001b[0m \u001b[31m2.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
44
- "\u001b[?25hRequirement already satisfied: packaging in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (23.1)\n",
45
- "Requirement already satisfied: pandas<3.0,>=1.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (2.1.1)\n",
46
- "Requirement already satisfied: pillow<11.0,>=8.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (10.0.1)\n",
47
- "Requirement already satisfied: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (2.3.0)\n",
48
  "Collecting pydub (from gradio)\n",
49
  " Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
50
  "Collecting python-multipart (from gradio)\n",
51
  " Downloading python_multipart-0.0.6-py3-none-any.whl (45 kB)\n",
52
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m3.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
53
- "\u001b[?25hRequirement already satisfied: pyyaml<7.0,>=5.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (6.0.1)\n",
54
- "Requirement already satisfied: requests~=2.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (2.31.0)\n",
55
  "Collecting semantic-version~=2.0 (from gradio)\n",
56
  " Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n",
57
- "Requirement already satisfied: typing-extensions~=4.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (4.8.0)\n",
58
  "Collecting uvicorn>=0.14.0 (from gradio)\n",
59
  " Obtaining dependency information for uvicorn>=0.14.0 from https://files.pythonhosted.org/packages/79/96/b0882a1c3f7ef3dd86879e041212ae5b62b4bd352320889231cc735a8e8f/uvicorn-0.23.2-py3-none-any.whl.metadata\n",
60
  " Downloading uvicorn-0.23.2-py3-none-any.whl.metadata (6.2 kB)\n",
61
  "Collecting websockets<12.0,>=10.0 (from gradio)\n",
62
  " 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",
63
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m2.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
64
- "\u001b[?25hRequirement already satisfied: fsspec in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio-client==0.6.1->gradio) (2023.10.0)\n",
65
- "Requirement already satisfied: jsonschema>=3.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (4.19.1)\n",
66
- "Requirement already satisfied: toolz in /home/josh/mambaforge/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.0)\n",
67
- "Requirement already satisfied: filelock in /home/josh/mambaforge/lib/python3.10/site-packages (from huggingface-hub>=0.14.0->gradio) (3.12.4)\n",
68
- "Requirement already satisfied: tqdm>=4.42.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from huggingface-hub>=0.14.0->gradio) (4.66.1)\n",
69
- "Requirement already satisfied: contourpy>=1.0.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.1.1)\n",
70
- "Requirement already satisfied: cycler>=0.10 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (0.11.0)\n",
71
- "Requirement already satisfied: fonttools>=4.22.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (4.42.1)\n",
72
- "Requirement already satisfied: kiwisolver>=1.0.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\n",
73
- "Requirement already satisfied: pyparsing>=2.3.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (3.1.1)\n",
74
- "Requirement already satisfied: python-dateutil>=2.7 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (2.8.2)\n",
75
- "Requirement already satisfied: pytz>=2020.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3.post1)\n",
76
- "Requirement already satisfied: tzdata>=2022.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3)\n",
77
- "Requirement already satisfied: annotated-types>=0.4.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4->gradio) (0.5.0)\n",
78
- "Requirement already satisfied: pydantic-core==2.6.3 in /home/josh/mambaforge/lib/python3.10/site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4->gradio) (2.6.3)\n",
79
- "Requirement already satisfied: charset-normalizer<4,>=2 in /home/josh/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (3.2.0)\n",
80
- "Requirement already satisfied: idna<4,>=2.5 in /home/josh/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (3.4)\n",
81
- "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (2.0.4)\n",
82
- "Requirement already satisfied: certifi>=2017.4.17 in /home/josh/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (2023.7.22)\n",
83
- "Requirement already satisfied: click>=7.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from uvicorn>=0.14.0->gradio) (8.1.7)\n",
84
  "Collecting h11>=0.8 (from uvicorn>=0.14.0->gradio)\n",
85
  " Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n",
86
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m4.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
87
  "\u001b[?25hCollecting anyio<4.0.0,>=3.7.1 (from fastapi->gradio)\n",
88
  " Obtaining dependency information for anyio<4.0.0,>=3.7.1 from https://files.pythonhosted.org/packages/19/24/44299477fe7dcc9cb58d0a57d5a7588d6af2ff403fdd2d47a246c91a3246/anyio-3.7.1-py3-none-any.whl.metadata\n",
89
  " Downloading anyio-3.7.1-py3-none-any.whl.metadata (4.7 kB)\n",
@@ -93,45 +93,47 @@
93
  "Collecting httpcore<0.19.0,>=0.18.0 (from httpx->gradio)\n",
94
  " Obtaining dependency information for httpcore<0.19.0,>=0.18.0 from https://files.pythonhosted.org/packages/ac/97/724afbb7925339f6214bf1fdb5714d1a462690466832bf8fb3fd497649f1/httpcore-0.18.0-py3-none-any.whl.metadata\n",
95
  " Downloading httpcore-0.18.0-py3-none-any.whl.metadata (18 kB)\n",
96
- "Requirement already satisfied: sniffio in /home/josh/mambaforge/lib/python3.10/site-packages (from httpx->gradio) (1.3.0)\n",
97
- "Requirement already satisfied: exceptiongroup in /home/josh/mambaforge/lib/python3.10/site-packages (from anyio<4.0.0,>=3.7.1->fastapi->gradio) (1.1.3)\n",
98
- "Requirement already satisfied: attrs>=22.2.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.1.0)\n",
99
- "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/josh/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.7.1)\n",
100
- "Requirement already satisfied: referencing>=0.28.4 in /home/josh/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.30.2)\n",
101
- "Requirement already satisfied: rpds-py>=0.7.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.10.6)\n",
102
- "Requirement already satisfied: six>=1.5 in /home/josh/mambaforge/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\n",
103
  "Downloading gradio-3.50.2-py3-none-any.whl (20.3 MB)\n",
104
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m20.3/20.3 MB\u001b[0m \u001b[31m6.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
105
  "\u001b[?25hDownloading gradio_client-0.6.1-py3-none-any.whl (299 kB)\n",
106
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m299.2/299.2 kB\u001b[0m \u001b[31m4.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
107
  "\u001b[?25hDownloading aiofiles-23.2.1-py3-none-any.whl (15 kB)\n",
108
  "Downloading altair-5.1.2-py3-none-any.whl (516 kB)\n",
109
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m516.2/516.2 kB\u001b[0m \u001b[31m6.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
110
  "\u001b[?25hDownloading orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138 kB)\n",
111
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m138.7/138.7 kB\u001b[0m \u001b[31m6.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
112
  "\u001b[?25hDownloading uvicorn-0.23.2-py3-none-any.whl (59 kB)\n",
113
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m59.5/59.5 kB\u001b[0m \u001b[31m5.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
114
  "\u001b[?25hDownloading fastapi-0.104.0-py3-none-any.whl (92 kB)\n",
115
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m92.9/92.9 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
116
  "\u001b[?25hDownloading httpx-0.25.0-py3-none-any.whl (75 kB)\n",
117
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.7/75.7 kB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
118
  "\u001b[?25hDownloading anyio-3.7.1-py3-none-any.whl (80 kB)\n",
119
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m80.9/80.9 kB\u001b[0m \u001b[31m5.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
120
  "\u001b[?25hDownloading httpcore-0.18.0-py3-none-any.whl (76 kB)\n",
121
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m76.0/76.0 kB\u001b[0m \u001b[31m4.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
122
  "\u001b[?25hDownloading starlette-0.27.0-py3-none-any.whl (66 kB)\n",
123
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m67.0/67.0 kB\u001b[0m \u001b[31m3.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
124
  "\u001b[?25hBuilding wheels for collected packages: ffmpy\n",
125
  " Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n",
126
- "\u001b[?25h Created wheel for ffmpy: filename=ffmpy-0.3.1-py3-none-any.whl size=5579 sha256=b8d75b98ebdb569d9133fee542146e07d8256f8a0b2cb763e2b59ce08cb9bbb5\n",
127
- " Stored in directory: /home/josh/.cache/pip/wheels/01/a6/d1/1c0828c304a4283b2c1639a09ad86f83d7c487ef34c6b4a1bf\n",
128
  "Successfully built ffmpy\n",
129
  "Installing collected packages: pydub, ffmpy, websockets, semantic-version, python-multipart, orjson, h11, anyio, aiofiles, uvicorn, starlette, httpcore, httpx, fastapi, gradio-client, altair, gradio\n",
130
  " Attempting uninstall: anyio\n",
131
  " Found existing installation: anyio 4.0.0\n",
132
  " Uninstalling anyio-4.0.0:\n",
133
  " Successfully uninstalled anyio-4.0.0\n",
134
- "Successfully installed aiofiles-23.2.1 altair-5.1.2 anyio-3.7.1 fastapi-0.104.0 ffmpy-0.3.1 gradio-3.50.2 gradio-client-0.6.1 h11-0.14.0 httpcore-0.18.0 httpx-0.25.0 orjson-3.9.9 pydub-0.25.1 python-multipart-0.0.6 semantic-version-2.10.0 starlette-0.27.0 uvicorn-0.23.2 websockets-11.0.3\n"
 
 
135
  ]
136
  }
137
  ],
@@ -142,7 +144,7 @@
142
  },
143
  {
144
  "cell_type": "code",
145
- "execution_count": 1,
146
  "id": "61b17aee-d54d-45dd-970b-7f5e22c762e7",
147
  "metadata": {},
148
  "outputs": [],
@@ -159,7 +161,7 @@
159
  },
160
  {
161
  "cell_type": "code",
162
- "execution_count": 5,
163
  "id": "d2752fb9-736e-4999-b796-f50925dd535e",
164
  "metadata": {},
165
  "outputs": [
@@ -171,7 +173,7 @@
171
  "PILImage mode=RGB size=173x192"
172
  ]
173
  },
174
- "execution_count": 5,
175
  "metadata": {},
176
  "output_type": "execute_result"
177
  }
@@ -189,12 +191,12 @@
189
  "metadata": {},
190
  "outputs": [],
191
  "source": [
192
- "learn = load_learner(\"flower_id_export.pkl\")\n"
193
  ]
194
  },
195
  {
196
  "cell_type": "code",
197
- "execution_count": 16,
198
  "id": "a3eda266-632e-4c58-acf9-8cbcab764cdf",
199
  "metadata": {},
200
  "outputs": [
@@ -242,7 +244,7 @@
242
  },
243
  {
244
  "cell_type": "code",
245
- "execution_count": 15,
246
  "id": "78e26b4b-703c-47a6-9711-a7b433ffdbe3",
247
  "metadata": {},
248
  "outputs": [
@@ -252,7 +254,7 @@
252
  "['Hellebore flowers', 'Peoneis flowers', 'Rose flowers', 'Sunflower']"
253
  ]
254
  },
255
- "execution_count": 15,
256
  "metadata": {},
257
  "output_type": "execute_result"
258
  }
@@ -264,20 +266,20 @@
264
  },
265
  {
266
  "cell_type": "code",
267
- "execution_count": 23,
268
  "id": "56aff529-c0f3-4ded-80e5-a06a2d12346c",
269
  "metadata": {},
270
  "outputs": [
271
  {
272
  "data": {
273
  "text/plain": [
274
- "{'Hellebore flowers': 4.385266493045492e-06,\n",
275
- " 'Peoneis flowers': 2.3386392058455385e-06,\n",
276
- " 'Rose flowers': 1.7962941001314903e-06,\n",
277
- " 'Sunflower': 0.9999915361404419}"
278
  ]
279
  },
280
- "execution_count": 23,
281
  "metadata": {},
282
  "output_type": "execute_result"
283
  }
@@ -289,17 +291,20 @@
289
  },
290
  {
291
  "cell_type": "code",
292
- "execution_count": 22,
293
  "id": "67cbf81d-95d8-4f8c-9101-f2efb175b578",
294
  "metadata": {},
295
  "outputs": [
296
  {
297
  "data": {
298
  "text/plain": [
299
- "{}"
 
 
 
300
  ]
301
  },
302
- "execution_count": 22,
303
  "metadata": {},
304
  "output_type": "execute_result"
305
  }
@@ -310,9 +315,310 @@
310
  },
311
  {
312
  "cell_type": "code",
313
- "execution_count": null,
314
  "id": "669444a6-01e1-4dcc-a314-18580ae3d6c5",
315
  "metadata": {},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  "outputs": [],
317
  "source": []
318
  }
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": 1,
6
  "id": "c31ed028-ddf3-4c13-8049-1b67bf184a98",
7
  "metadata": {},
8
  "outputs": [
 
31
  "Collecting httpx (from gradio)\n",
32
  " Obtaining dependency information for httpx from https://files.pythonhosted.org/packages/33/0d/d9ce469af019741c8999711d36b270ff992ceb1a0293f73f9f34fdf131e9/httpx-0.25.0-py3-none-any.whl.metadata\n",
33
  " Downloading httpx-0.25.0-py3-none-any.whl.metadata (7.6 kB)\n",
34
+ "Requirement already satisfied: huggingface-hub>=0.14.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (0.17.3)\n",
35
+ "Requirement already satisfied: importlib-resources<7.0,>=1.3 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (6.1.0)\n",
36
+ "Requirement already satisfied: jinja2<4.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (3.1.2)\n",
37
+ "Requirement already satisfied: markupsafe~=2.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (2.1.3)\n",
38
+ "Requirement already satisfied: matplotlib~=3.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (3.8.0)\n",
39
+ "Requirement already satisfied: numpy~=1.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (1.26.0)\n",
40
  "Collecting orjson~=3.0 (from gradio)\n",
41
  " Obtaining dependency information for orjson~=3.0 from https://files.pythonhosted.org/packages/f4/66/d13cb488f5e74d603ebeb0b7b5032a81462d76d0b197a7b2002843ca1055/orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata\n",
42
  " Downloading orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (49 kB)\n",
43
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.3/49.3 kB\u001b[0m \u001b[31m1.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
44
+ "\u001b[?25hRequirement already satisfied: packaging in /root/mambaforge/lib/python3.10/site-packages (from gradio) (23.1)\n",
45
+ "Requirement already satisfied: pandas<3.0,>=1.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (2.1.1)\n",
46
+ "Requirement already satisfied: pillow<11.0,>=8.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (10.0.1)\n",
47
+ "Requirement already satisfied: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (2.4.2)\n",
48
  "Collecting pydub (from gradio)\n",
49
  " Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
50
  "Collecting python-multipart (from gradio)\n",
51
  " Downloading python_multipart-0.0.6-py3-none-any.whl (45 kB)\n",
52
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━��━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m485.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m \u001b[36m0:00:01\u001b[0m\n",
53
+ "\u001b[?25hRequirement already satisfied: pyyaml<7.0,>=5.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (6.0.1)\n",
54
+ "Requirement already satisfied: requests~=2.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (2.31.0)\n",
55
  "Collecting semantic-version~=2.0 (from gradio)\n",
56
  " Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n",
57
+ "Requirement already satisfied: typing-extensions~=4.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (4.8.0)\n",
58
  "Collecting uvicorn>=0.14.0 (from gradio)\n",
59
  " Obtaining dependency information for uvicorn>=0.14.0 from https://files.pythonhosted.org/packages/79/96/b0882a1c3f7ef3dd86879e041212ae5b62b4bd352320889231cc735a8e8f/uvicorn-0.23.2-py3-none-any.whl.metadata\n",
60
  " Downloading uvicorn-0.23.2-py3-none-any.whl.metadata (6.2 kB)\n",
61
  "Collecting websockets<12.0,>=10.0 (from gradio)\n",
62
  " 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",
63
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m737.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
64
+ "\u001b[?25hRequirement already satisfied: fsspec in /root/mambaforge/lib/python3.10/site-packages (from gradio-client==0.6.1->gradio) (2023.10.0)\n",
65
+ "Requirement already satisfied: jsonschema>=3.0 in /root/mambaforge/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (4.19.1)\n",
66
+ "Requirement already satisfied: toolz in /root/mambaforge/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.0)\n",
67
+ "Requirement already satisfied: filelock in /root/mambaforge/lib/python3.10/site-packages (from huggingface-hub>=0.14.0->gradio) (3.12.4)\n",
68
+ "Requirement already satisfied: tqdm>=4.42.1 in /root/mambaforge/lib/python3.10/site-packages (from huggingface-hub>=0.14.0->gradio) (4.66.1)\n",
69
+ "Requirement already satisfied: contourpy>=1.0.1 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.1.1)\n",
70
+ "Requirement already satisfied: cycler>=0.10 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (0.12.1)\n",
71
+ "Requirement already satisfied: fonttools>=4.22.0 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (4.43.1)\n",
72
+ "Requirement already satisfied: kiwisolver>=1.0.1 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\n",
73
+ "Requirement already satisfied: pyparsing>=2.3.1 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (3.1.1)\n",
74
+ "Requirement already satisfied: python-dateutil>=2.7 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (2.8.2)\n",
75
+ "Requirement already satisfied: pytz>=2020.1 in /root/mambaforge/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3.post1)\n",
76
+ "Requirement already satisfied: tzdata>=2022.1 in /root/mambaforge/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3)\n",
77
+ "Requirement already satisfied: annotated-types>=0.4.0 in /root/mambaforge/lib/python3.10/site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4->gradio) (0.6.0)\n",
78
+ "Requirement already satisfied: pydantic-core==2.10.1 in /root/mambaforge/lib/python3.10/site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4->gradio) (2.10.1)\n",
79
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /root/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (3.2.0)\n",
80
+ "Requirement already satisfied: idna<4,>=2.5 in /root/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (3.4)\n",
81
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /root/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (2.0.4)\n",
82
+ "Requirement already satisfied: certifi>=2017.4.17 in /root/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (2023.7.22)\n",
83
+ "Requirement already satisfied: click>=7.0 in /root/mambaforge/lib/python3.10/site-packages (from uvicorn>=0.14.0->gradio) (8.1.7)\n",
84
  "Collecting h11>=0.8 (from uvicorn>=0.14.0->gradio)\n",
85
  " Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n",
86
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m973.6 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:--:--\u001b[0m\n",
87
  "\u001b[?25hCollecting anyio<4.0.0,>=3.7.1 (from fastapi->gradio)\n",
88
  " Obtaining dependency information for anyio<4.0.0,>=3.7.1 from https://files.pythonhosted.org/packages/19/24/44299477fe7dcc9cb58d0a57d5a7588d6af2ff403fdd2d47a246c91a3246/anyio-3.7.1-py3-none-any.whl.metadata\n",
89
  " Downloading anyio-3.7.1-py3-none-any.whl.metadata (4.7 kB)\n",
 
93
  "Collecting httpcore<0.19.0,>=0.18.0 (from httpx->gradio)\n",
94
  " Obtaining dependency information for httpcore<0.19.0,>=0.18.0 from https://files.pythonhosted.org/packages/ac/97/724afbb7925339f6214bf1fdb5714d1a462690466832bf8fb3fd497649f1/httpcore-0.18.0-py3-none-any.whl.metadata\n",
95
  " Downloading httpcore-0.18.0-py3-none-any.whl.metadata (18 kB)\n",
96
+ "Requirement already satisfied: sniffio in /root/mambaforge/lib/python3.10/site-packages (from httpx->gradio) (1.3.0)\n",
97
+ "Requirement already satisfied: exceptiongroup in /root/mambaforge/lib/python3.10/site-packages (from anyio<4.0.0,>=3.7.1->fastapi->gradio) (1.1.3)\n",
98
+ "Requirement already satisfied: attrs>=22.2.0 in /root/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.1.0)\n",
99
+ "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /root/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.7.1)\n",
100
+ "Requirement already satisfied: referencing>=0.28.4 in /root/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.30.2)\n",
101
+ "Requirement already satisfied: rpds-py>=0.7.1 in /root/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.10.6)\n",
102
+ "Requirement already satisfied: six>=1.5 in /root/mambaforge/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\n",
103
  "Downloading gradio-3.50.2-py3-none-any.whl (20.3 MB)\n",
104
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m20.3/20.3 MB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m0m\n",
105
  "\u001b[?25hDownloading gradio_client-0.6.1-py3-none-any.whl (299 kB)\n",
106
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m299.2/299.2 kB\u001b[0m \u001b[31m1.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
107
  "\u001b[?25hDownloading aiofiles-23.2.1-py3-none-any.whl (15 kB)\n",
108
  "Downloading altair-5.1.2-py3-none-any.whl (516 kB)\n",
109
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m516.2/516.2 kB\u001b[0m \u001b[31m870.8 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
110
  "\u001b[?25hDownloading orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138 kB)\n",
111
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m138.7/138.7 kB\u001b[0m \u001b[31m969.4 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m \u001b[36m0:00:01\u001b[0mm\n",
112
  "\u001b[?25hDownloading uvicorn-0.23.2-py3-none-any.whl (59 kB)\n",
113
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m59.5/59.5 kB\u001b[0m \u001b[31m1.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
114
  "\u001b[?25hDownloading fastapi-0.104.0-py3-none-any.whl (92 kB)\n",
115
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m92.9/92.9 kB\u001b[0m \u001b[31m759.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\u001b[36m0:00:01\u001b[0m\n",
116
  "\u001b[?25hDownloading httpx-0.25.0-py3-none-any.whl (75 kB)\n",
117
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.7/75.7 kB\u001b[0m \u001b[31m474.5 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
118
  "\u001b[?25hDownloading anyio-3.7.1-py3-none-any.whl (80 kB)\n",
119
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m80.9/80.9 kB\u001b[0m \u001b[31m793.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
120
  "\u001b[?25hDownloading httpcore-0.18.0-py3-none-any.whl (76 kB)\n",
121
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m76.0/76.0 kB\u001b[0m \u001b[31m675.4 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
122
  "\u001b[?25hDownloading starlette-0.27.0-py3-none-any.whl (66 kB)\n",
123
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m67.0/67.0 kB\u001b[0m \u001b[31m785.8 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
124
  "\u001b[?25hBuilding wheels for collected packages: ffmpy\n",
125
  " Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n",
126
+ "\u001b[?25h Created wheel for ffmpy: filename=ffmpy-0.3.1-py3-none-any.whl size=5579 sha256=e859e109fb7c92cb351720285b57433a58147d1c2d7b4e4233558a559711dae5\n",
127
+ " Stored in directory: /root/.cache/pip/wheels/01/a6/d1/1c0828c304a4283b2c1639a09ad86f83d7c487ef34c6b4a1bf\n",
128
  "Successfully built ffmpy\n",
129
  "Installing collected packages: pydub, ffmpy, websockets, semantic-version, python-multipart, orjson, h11, anyio, aiofiles, uvicorn, starlette, httpcore, httpx, fastapi, gradio-client, altair, gradio\n",
130
  " Attempting uninstall: anyio\n",
131
  " Found existing installation: anyio 4.0.0\n",
132
  " Uninstalling anyio-4.0.0:\n",
133
  " Successfully uninstalled anyio-4.0.0\n",
134
+ "Successfully installed aiofiles-23.2.1 altair-5.1.2 anyio-3.7.1 fastapi-0.104.0 ffmpy-0.3.1 gradio-3.50.2 gradio-client-0.6.1 h11-0.14.0 httpcore-0.18.0 httpx-0.25.0 orjson-3.9.9 pydub-0.25.1 python-multipart-0.0.6 semantic-version-2.10.0 starlette-0.27.0 uvicorn-0.23.2 websockets-11.0.3\n",
135
+ "\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n",
136
+ "\u001b[0m"
137
  ]
138
  }
139
  ],
 
144
  },
145
  {
146
  "cell_type": "code",
147
+ "execution_count": 2,
148
  "id": "61b17aee-d54d-45dd-970b-7f5e22c762e7",
149
  "metadata": {},
150
  "outputs": [],
 
161
  },
162
  {
163
  "cell_type": "code",
164
+ "execution_count": 3,
165
  "id": "d2752fb9-736e-4999-b796-f50925dd535e",
166
  "metadata": {},
167
  "outputs": [
 
173
  "PILImage mode=RGB size=173x192"
174
  ]
175
  },
176
+ "execution_count": 3,
177
  "metadata": {},
178
  "output_type": "execute_result"
179
  }
 
191
  "metadata": {},
192
  "outputs": [],
193
  "source": [
194
+ "learn = load_learner(\"export.pkl\")\n"
195
  ]
196
  },
197
  {
198
  "cell_type": "code",
199
+ "execution_count": 7,
200
  "id": "a3eda266-632e-4c58-acf9-8cbcab764cdf",
201
  "metadata": {},
202
  "outputs": [
 
244
  },
245
  {
246
  "cell_type": "code",
247
+ "execution_count": 8,
248
  "id": "78e26b4b-703c-47a6-9711-a7b433ffdbe3",
249
  "metadata": {},
250
  "outputs": [
 
254
  "['Hellebore flowers', 'Peoneis flowers', 'Rose flowers', 'Sunflower']"
255
  ]
256
  },
257
+ "execution_count": 8,
258
  "metadata": {},
259
  "output_type": "execute_result"
260
  }
 
266
  },
267
  {
268
  "cell_type": "code",
269
+ "execution_count": 9,
270
  "id": "56aff529-c0f3-4ded-80e5-a06a2d12346c",
271
  "metadata": {},
272
  "outputs": [
273
  {
274
  "data": {
275
  "text/plain": [
276
+ "{'Hellebore flowers': 7.141724154280382e-07,\n",
277
+ " 'Peoneis flowers': 1.4747066643394646e-06,\n",
278
+ " 'Rose flowers': 6.034231887497299e-07,\n",
279
+ " 'Sunflower': 0.9999972581863403}"
280
  ]
281
  },
282
+ "execution_count": 9,
283
  "metadata": {},
284
  "output_type": "execute_result"
285
  }
 
291
  },
292
  {
293
  "cell_type": "code",
294
+ "execution_count": 10,
295
  "id": "67cbf81d-95d8-4f8c-9101-f2efb175b578",
296
  "metadata": {},
297
  "outputs": [
298
  {
299
  "data": {
300
  "text/plain": [
301
+ "{'Hellebore flowers': 7.141724154280382e-07,\n",
302
+ " 'Peoneis flowers': 1.4747066643394646e-06,\n",
303
+ " 'Rose flowers': 6.034231887497299e-07,\n",
304
+ " 'Sunflower': 0.9999972581863403}"
305
  ]
306
  },
307
+ "execution_count": 10,
308
  "metadata": {},
309
  "output_type": "execute_result"
310
  }
 
315
  },
316
  {
317
  "cell_type": "code",
318
+ "execution_count": 11,
319
  "id": "669444a6-01e1-4dcc-a314-18580ae3d6c5",
320
  "metadata": {},
321
+ "outputs": [
322
+ {
323
+ "data": {
324
+ "text/html": [
325
+ "\n",
326
+ "<style>\n",
327
+ " /* Turns off some styling */\n",
328
+ " progress {\n",
329
+ " /* gets rid of default border in Firefox and Opera. */\n",
330
+ " border: none;\n",
331
+ " /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
332
+ " background-size: auto;\n",
333
+ " }\n",
334
+ " progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
335
+ " background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
336
+ " }\n",
337
+ " .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
338
+ " background: #F44336;\n",
339
+ " }\n",
340
+ "</style>\n"
341
+ ],
342
+ "text/plain": [
343
+ "<IPython.core.display.HTML object>"
344
+ ]
345
+ },
346
+ "metadata": {},
347
+ "output_type": "display_data"
348
+ },
349
+ {
350
+ "data": {
351
+ "text/html": [],
352
+ "text/plain": [
353
+ "<IPython.core.display.HTML object>"
354
+ ]
355
+ },
356
+ "metadata": {},
357
+ "output_type": "display_data"
358
+ },
359
+ {
360
+ "data": {
361
+ "text/plain": [
362
+ "{'Hellebore flowers': 7.141724154280382e-07,\n",
363
+ " 'Peoneis flowers': 1.4747066643394646e-06,\n",
364
+ " 'Rose flowers': 6.034231887497299e-07,\n",
365
+ " 'Sunflower': 0.9999972581863403}"
366
+ ]
367
+ },
368
+ "execution_count": 11,
369
+ "metadata": {},
370
+ "output_type": "execute_result"
371
+ }
372
+ ],
373
+ "source": [
374
+ "def classify_image(img):\n",
375
+ " predict, idx, probs = learn.predict(img)\n",
376
+ " categories = learn.dls.vocab\n",
377
+ " return dict(zip(categories,map(float,probs)))\n",
378
+ "\n",
379
+ "results = classify_image(im)\n",
380
+ "results\n",
381
+ " "
382
+ ]
383
+ },
384
+ {
385
+ "cell_type": "code",
386
+ "execution_count": 16,
387
+ "id": "1020b745-5352-4874-92d2-a1ecdedf1e20",
388
+ "metadata": {},
389
+ "outputs": [
390
+ {
391
+ "name": "stderr",
392
+ "output_type": "stream",
393
+ "text": [
394
+ "/tmp/ipykernel_297/535013132.py:2: GradioDeprecationWarning: Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components\n",
395
+ " image = gr.inputs.Image(shape=(192,192))\n",
396
+ "/tmp/ipykernel_297/535013132.py:2: GradioDeprecationWarning: `optional` parameter is deprecated, and it has no effect\n",
397
+ " image = gr.inputs.Image(shape=(192,192))\n",
398
+ "/tmp/ipykernel_297/535013132.py:3: GradioDeprecationWarning: Usage of gradio.outputs is deprecated, and will not be supported in the future, please import your components from gradio.components\n",
399
+ " label = gr.outputs.Label()\n",
400
+ "/tmp/ipykernel_297/535013132.py:3: GradioUnusedKwargWarning: You have unused kwarg parameters in Label, please remove them: {'type': 'auto'}\n",
401
+ " label = gr.outputs.Label()\n"
402
+ ]
403
+ },
404
+ {
405
+ "name": "stdout",
406
+ "output_type": "stream",
407
+ "text": [
408
+ "Running on local URL: http://127.0.0.1:7861\n",
409
+ "\n",
410
+ "To create a public link, set `share=True` in `launch()`.\n"
411
+ ]
412
+ },
413
+ {
414
+ "data": {
415
+ "text/plain": []
416
+ },
417
+ "execution_count": 16,
418
+ "metadata": {},
419
+ "output_type": "execute_result"
420
+ },
421
+ {
422
+ "data": {
423
+ "text/html": [
424
+ "\n",
425
+ "<style>\n",
426
+ " /* Turns off some styling */\n",
427
+ " progress {\n",
428
+ " /* gets rid of default border in Firefox and Opera. */\n",
429
+ " border: none;\n",
430
+ " /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
431
+ " background-size: auto;\n",
432
+ " }\n",
433
+ " progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
434
+ " background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
435
+ " }\n",
436
+ " .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
437
+ " background: #F44336;\n",
438
+ " }\n",
439
+ "</style>\n"
440
+ ],
441
+ "text/plain": [
442
+ "<IPython.core.display.HTML object>"
443
+ ]
444
+ },
445
+ "metadata": {},
446
+ "output_type": "display_data"
447
+ },
448
+ {
449
+ "data": {
450
+ "text/html": [],
451
+ "text/plain": [
452
+ "<IPython.core.display.HTML object>"
453
+ ]
454
+ },
455
+ "metadata": {},
456
+ "output_type": "display_data"
457
+ },
458
+ {
459
+ "data": {
460
+ "text/html": [
461
+ "\n",
462
+ "<style>\n",
463
+ " /* Turns off some styling */\n",
464
+ " progress {\n",
465
+ " /* gets rid of default border in Firefox and Opera. */\n",
466
+ " border: none;\n",
467
+ " /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
468
+ " background-size: auto;\n",
469
+ " }\n",
470
+ " progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
471
+ " background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
472
+ " }\n",
473
+ " .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
474
+ " background: #F44336;\n",
475
+ " }\n",
476
+ "</style>\n"
477
+ ],
478
+ "text/plain": [
479
+ "<IPython.core.display.HTML object>"
480
+ ]
481
+ },
482
+ "metadata": {},
483
+ "output_type": "display_data"
484
+ },
485
+ {
486
+ "data": {
487
+ "text/html": [],
488
+ "text/plain": [
489
+ "<IPython.core.display.HTML object>"
490
+ ]
491
+ },
492
+ "metadata": {},
493
+ "output_type": "display_data"
494
+ },
495
+ {
496
+ "data": {
497
+ "text/html": [
498
+ "\n",
499
+ "<style>\n",
500
+ " /* Turns off some styling */\n",
501
+ " progress {\n",
502
+ " /* gets rid of default border in Firefox and Opera. */\n",
503
+ " border: none;\n",
504
+ " /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
505
+ " background-size: auto;\n",
506
+ " }\n",
507
+ " progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
508
+ " background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
509
+ " }\n",
510
+ " .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
511
+ " background: #F44336;\n",
512
+ " }\n",
513
+ "</style>\n"
514
+ ],
515
+ "text/plain": [
516
+ "<IPython.core.display.HTML object>"
517
+ ]
518
+ },
519
+ "metadata": {},
520
+ "output_type": "display_data"
521
+ },
522
+ {
523
+ "data": {
524
+ "text/html": [],
525
+ "text/plain": [
526
+ "<IPython.core.display.HTML object>"
527
+ ]
528
+ },
529
+ "metadata": {},
530
+ "output_type": "display_data"
531
+ },
532
+ {
533
+ "data": {
534
+ "text/html": [
535
+ "\n",
536
+ "<style>\n",
537
+ " /* Turns off some styling */\n",
538
+ " progress {\n",
539
+ " /* gets rid of default border in Firefox and Opera. */\n",
540
+ " border: none;\n",
541
+ " /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
542
+ " background-size: auto;\n",
543
+ " }\n",
544
+ " progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
545
+ " background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
546
+ " }\n",
547
+ " .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
548
+ " background: #F44336;\n",
549
+ " }\n",
550
+ "</style>\n"
551
+ ],
552
+ "text/plain": [
553
+ "<IPython.core.display.HTML object>"
554
+ ]
555
+ },
556
+ "metadata": {},
557
+ "output_type": "display_data"
558
+ },
559
+ {
560
+ "data": {
561
+ "text/html": [],
562
+ "text/plain": [
563
+ "<IPython.core.display.HTML object>"
564
+ ]
565
+ },
566
+ "metadata": {},
567
+ "output_type": "display_data"
568
+ },
569
+ {
570
+ "data": {
571
+ "text/html": [
572
+ "\n",
573
+ "<style>\n",
574
+ " /* Turns off some styling */\n",
575
+ " progress {\n",
576
+ " /* gets rid of default border in Firefox and Opera. */\n",
577
+ " border: none;\n",
578
+ " /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
579
+ " background-size: auto;\n",
580
+ " }\n",
581
+ " progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
582
+ " background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
583
+ " }\n",
584
+ " .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
585
+ " background: #F44336;\n",
586
+ " }\n",
587
+ "</style>\n"
588
+ ],
589
+ "text/plain": [
590
+ "<IPython.core.display.HTML object>"
591
+ ]
592
+ },
593
+ "metadata": {},
594
+ "output_type": "display_data"
595
+ },
596
+ {
597
+ "data": {
598
+ "text/html": [],
599
+ "text/plain": [
600
+ "<IPython.core.display.HTML object>"
601
+ ]
602
+ },
603
+ "metadata": {},
604
+ "output_type": "display_data"
605
+ }
606
+ ],
607
+ "source": [
608
+ "#\n",
609
+ "image = gr.inputs.Image(shape=(192,192))\n",
610
+ "label = gr.outputs.Label()\n",
611
+ "examples = [\"sunflower.jpg\",\"Peonies.jpeg\",\"Hellebore.jpg\",\"Rose.jpg\"]\n",
612
+ "\n",
613
+ "intf = gr.Interface(fn=classify_image, inputs=image,outputs=label,examples=examples)\n",
614
+ "intf.launch(inline=False)"
615
+ ]
616
+ },
617
+ {
618
+ "cell_type": "code",
619
+ "execution_count": null,
620
+ "id": "87c95918-a681-4c3f-9882-b6d80d586444",
621
+ "metadata": {},
622
  "outputs": [],
623
  "source": []
624
  }
Hellebore.jpg ADDED
Peonies.jpeg ADDED
Rose.jpg ADDED
app.py CHANGED
@@ -1,7 +1,28 @@
1
- import gradio as gr
2
 
3
  def greet(name):
4
  return "Hello " + name + "!!"
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """import gradio as gr
2
 
3
  def greet(name):
4
  return "Hello " + name + "!!"
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
+ iface.launch()"""
8
+
9
+
10
+ #|export
11
+ from fastai.vision.all import *
12
+ import gradio as gr
13
+
14
+ #|export
15
+ def classify_image(img):
16
+ predict, idx, probs = learn.predict(img)
17
+ categories = learn.dls.vocab
18
+ return dict(zip(categories,map(float,probs)))
19
+
20
+ #|export
21
+ image = gr.inputs.Image(shape=(192,192))
22
+ label = gr.outputs.Label()
23
+ examples = ["sunflower.jpg","Peonies.jpeg","Hellebore.jpg","Rose.jpg"]
24
+
25
+ intf = gr.Interface(fn=classify_image, inputs=image,outputs=label,examples=examples)
26
+ intf.launch(inline=False)
27
+
28
+
flower_id_export.pkl → export.pkl RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:19a6248c730b2f5d6c072eb93e5da7c3b80dcf64cc167dd625dedca7b43b60ca
3
- size 46978110
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e059fa15fc0a9ebf861291d8f8aeb914a00b08cdec6ea691c586dc6c66432fc
3
+ size 46978302
flower_classifyer_export.pklZone.Identifier DELETED
@@ -1,3 +0,0 @@
1
- [ZoneTransfer]
2
- ZoneId=3
3
- HostUrl=about:internet
 
 
 
 
sunflower.jpgZone.Identifier DELETED
@@ -1,3 +0,0 @@
1
- [ZoneTransfer]
2
- ZoneId=3
3
- HostUrl=about:internet
 
 
 
 
testing.ipynb CHANGED
@@ -2,7 +2,7 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 4,
6
  "id": "c31ed028-ddf3-4c13-8049-1b67bf184a98",
7
  "metadata": {},
8
  "outputs": [
@@ -31,59 +31,59 @@
31
  "Collecting httpx (from gradio)\n",
32
  " Obtaining dependency information for httpx from https://files.pythonhosted.org/packages/33/0d/d9ce469af019741c8999711d36b270ff992ceb1a0293f73f9f34fdf131e9/httpx-0.25.0-py3-none-any.whl.metadata\n",
33
  " Downloading httpx-0.25.0-py3-none-any.whl.metadata (7.6 kB)\n",
34
- "Requirement already satisfied: huggingface-hub>=0.14.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (0.17.3)\n",
35
- "Requirement already satisfied: importlib-resources<7.0,>=1.3 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (6.1.0)\n",
36
- "Requirement already satisfied: jinja2<4.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (3.1.2)\n",
37
- "Requirement already satisfied: markupsafe~=2.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (2.1.3)\n",
38
- "Requirement already satisfied: matplotlib~=3.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (3.8.0)\n",
39
- "Requirement already satisfied: numpy~=1.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (1.26.0)\n",
40
  "Collecting orjson~=3.0 (from gradio)\n",
41
  " Obtaining dependency information for orjson~=3.0 from https://files.pythonhosted.org/packages/f4/66/d13cb488f5e74d603ebeb0b7b5032a81462d76d0b197a7b2002843ca1055/orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata\n",
42
  " Downloading orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (49 kB)\n",
43
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.3/49.3 kB\u001b[0m \u001b[31m2.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
44
- "\u001b[?25hRequirement already satisfied: packaging in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (23.1)\n",
45
- "Requirement already satisfied: pandas<3.0,>=1.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (2.1.1)\n",
46
- "Requirement already satisfied: pillow<11.0,>=8.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (10.0.1)\n",
47
- "Requirement already satisfied: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (2.3.0)\n",
48
  "Collecting pydub (from gradio)\n",
49
  " Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
50
  "Collecting python-multipart (from gradio)\n",
51
  " Downloading python_multipart-0.0.6-py3-none-any.whl (45 kB)\n",
52
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m3.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
53
- "\u001b[?25hRequirement already satisfied: pyyaml<7.0,>=5.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (6.0.1)\n",
54
- "Requirement already satisfied: requests~=2.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (2.31.0)\n",
55
  "Collecting semantic-version~=2.0 (from gradio)\n",
56
  " Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n",
57
- "Requirement already satisfied: typing-extensions~=4.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio) (4.8.0)\n",
58
  "Collecting uvicorn>=0.14.0 (from gradio)\n",
59
  " Obtaining dependency information for uvicorn>=0.14.0 from https://files.pythonhosted.org/packages/79/96/b0882a1c3f7ef3dd86879e041212ae5b62b4bd352320889231cc735a8e8f/uvicorn-0.23.2-py3-none-any.whl.metadata\n",
60
  " Downloading uvicorn-0.23.2-py3-none-any.whl.metadata (6.2 kB)\n",
61
  "Collecting websockets<12.0,>=10.0 (from gradio)\n",
62
  " 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",
63
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m2.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
64
- "\u001b[?25hRequirement already satisfied: fsspec in /home/josh/mambaforge/lib/python3.10/site-packages (from gradio-client==0.6.1->gradio) (2023.10.0)\n",
65
- "Requirement already satisfied: jsonschema>=3.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (4.19.1)\n",
66
- "Requirement already satisfied: toolz in /home/josh/mambaforge/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.0)\n",
67
- "Requirement already satisfied: filelock in /home/josh/mambaforge/lib/python3.10/site-packages (from huggingface-hub>=0.14.0->gradio) (3.12.4)\n",
68
- "Requirement already satisfied: tqdm>=4.42.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from huggingface-hub>=0.14.0->gradio) (4.66.1)\n",
69
- "Requirement already satisfied: contourpy>=1.0.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.1.1)\n",
70
- "Requirement already satisfied: cycler>=0.10 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (0.11.0)\n",
71
- "Requirement already satisfied: fonttools>=4.22.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (4.42.1)\n",
72
- "Requirement already satisfied: kiwisolver>=1.0.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\n",
73
- "Requirement already satisfied: pyparsing>=2.3.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (3.1.1)\n",
74
- "Requirement already satisfied: python-dateutil>=2.7 in /home/josh/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (2.8.2)\n",
75
- "Requirement already satisfied: pytz>=2020.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3.post1)\n",
76
- "Requirement already satisfied: tzdata>=2022.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3)\n",
77
- "Requirement already satisfied: annotated-types>=0.4.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4->gradio) (0.5.0)\n",
78
- "Requirement already satisfied: pydantic-core==2.6.3 in /home/josh/mambaforge/lib/python3.10/site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4->gradio) (2.6.3)\n",
79
- "Requirement already satisfied: charset-normalizer<4,>=2 in /home/josh/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (3.2.0)\n",
80
- "Requirement already satisfied: idna<4,>=2.5 in /home/josh/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (3.4)\n",
81
- "Requirement already satisfied: urllib3<3,>=1.21.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (2.0.4)\n",
82
- "Requirement already satisfied: certifi>=2017.4.17 in /home/josh/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (2023.7.22)\n",
83
- "Requirement already satisfied: click>=7.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from uvicorn>=0.14.0->gradio) (8.1.7)\n",
84
  "Collecting h11>=0.8 (from uvicorn>=0.14.0->gradio)\n",
85
  " Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n",
86
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m4.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
87
  "\u001b[?25hCollecting anyio<4.0.0,>=3.7.1 (from fastapi->gradio)\n",
88
  " Obtaining dependency information for anyio<4.0.0,>=3.7.1 from https://files.pythonhosted.org/packages/19/24/44299477fe7dcc9cb58d0a57d5a7588d6af2ff403fdd2d47a246c91a3246/anyio-3.7.1-py3-none-any.whl.metadata\n",
89
  " Downloading anyio-3.7.1-py3-none-any.whl.metadata (4.7 kB)\n",
@@ -93,45 +93,47 @@
93
  "Collecting httpcore<0.19.0,>=0.18.0 (from httpx->gradio)\n",
94
  " Obtaining dependency information for httpcore<0.19.0,>=0.18.0 from https://files.pythonhosted.org/packages/ac/97/724afbb7925339f6214bf1fdb5714d1a462690466832bf8fb3fd497649f1/httpcore-0.18.0-py3-none-any.whl.metadata\n",
95
  " Downloading httpcore-0.18.0-py3-none-any.whl.metadata (18 kB)\n",
96
- "Requirement already satisfied: sniffio in /home/josh/mambaforge/lib/python3.10/site-packages (from httpx->gradio) (1.3.0)\n",
97
- "Requirement already satisfied: exceptiongroup in /home/josh/mambaforge/lib/python3.10/site-packages (from anyio<4.0.0,>=3.7.1->fastapi->gradio) (1.1.3)\n",
98
- "Requirement already satisfied: attrs>=22.2.0 in /home/josh/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.1.0)\n",
99
- "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/josh/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.7.1)\n",
100
- "Requirement already satisfied: referencing>=0.28.4 in /home/josh/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.30.2)\n",
101
- "Requirement already satisfied: rpds-py>=0.7.1 in /home/josh/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.10.6)\n",
102
- "Requirement already satisfied: six>=1.5 in /home/josh/mambaforge/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\n",
103
  "Downloading gradio-3.50.2-py3-none-any.whl (20.3 MB)\n",
104
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m20.3/20.3 MB\u001b[0m \u001b[31m6.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
105
  "\u001b[?25hDownloading gradio_client-0.6.1-py3-none-any.whl (299 kB)\n",
106
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m299.2/299.2 kB\u001b[0m \u001b[31m4.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
107
  "\u001b[?25hDownloading aiofiles-23.2.1-py3-none-any.whl (15 kB)\n",
108
  "Downloading altair-5.1.2-py3-none-any.whl (516 kB)\n",
109
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m516.2/516.2 kB\u001b[0m \u001b[31m6.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
110
  "\u001b[?25hDownloading orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138 kB)\n",
111
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m138.7/138.7 kB\u001b[0m \u001b[31m6.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
112
  "\u001b[?25hDownloading uvicorn-0.23.2-py3-none-any.whl (59 kB)\n",
113
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m59.5/59.5 kB\u001b[0m \u001b[31m5.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
114
  "\u001b[?25hDownloading fastapi-0.104.0-py3-none-any.whl (92 kB)\n",
115
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m92.9/92.9 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
116
  "\u001b[?25hDownloading httpx-0.25.0-py3-none-any.whl (75 kB)\n",
117
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.7/75.7 kB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
118
  "\u001b[?25hDownloading anyio-3.7.1-py3-none-any.whl (80 kB)\n",
119
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m80.9/80.9 kB\u001b[0m \u001b[31m5.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
120
  "\u001b[?25hDownloading httpcore-0.18.0-py3-none-any.whl (76 kB)\n",
121
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m76.0/76.0 kB\u001b[0m \u001b[31m4.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
122
  "\u001b[?25hDownloading starlette-0.27.0-py3-none-any.whl (66 kB)\n",
123
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m67.0/67.0 kB\u001b[0m \u001b[31m3.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
124
  "\u001b[?25hBuilding wheels for collected packages: ffmpy\n",
125
  " Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n",
126
- "\u001b[?25h Created wheel for ffmpy: filename=ffmpy-0.3.1-py3-none-any.whl size=5579 sha256=b8d75b98ebdb569d9133fee542146e07d8256f8a0b2cb763e2b59ce08cb9bbb5\n",
127
- " Stored in directory: /home/josh/.cache/pip/wheels/01/a6/d1/1c0828c304a4283b2c1639a09ad86f83d7c487ef34c6b4a1bf\n",
128
  "Successfully built ffmpy\n",
129
  "Installing collected packages: pydub, ffmpy, websockets, semantic-version, python-multipart, orjson, h11, anyio, aiofiles, uvicorn, starlette, httpcore, httpx, fastapi, gradio-client, altair, gradio\n",
130
  " Attempting uninstall: anyio\n",
131
  " Found existing installation: anyio 4.0.0\n",
132
  " Uninstalling anyio-4.0.0:\n",
133
  " Successfully uninstalled anyio-4.0.0\n",
134
- "Successfully installed aiofiles-23.2.1 altair-5.1.2 anyio-3.7.1 fastapi-0.104.0 ffmpy-0.3.1 gradio-3.50.2 gradio-client-0.6.1 h11-0.14.0 httpcore-0.18.0 httpx-0.25.0 orjson-3.9.9 pydub-0.25.1 python-multipart-0.0.6 semantic-version-2.10.0 starlette-0.27.0 uvicorn-0.23.2 websockets-11.0.3\n"
 
 
135
  ]
136
  }
137
  ],
@@ -142,11 +144,12 @@
142
  },
143
  {
144
  "cell_type": "code",
145
- "execution_count": 1,
146
  "id": "61b17aee-d54d-45dd-970b-7f5e22c762e7",
147
  "metadata": {},
148
  "outputs": [],
149
  "source": [
 
150
  "from fastai.vision.all import *\n",
151
  "import gradio as gr"
152
  ]
@@ -159,7 +162,7 @@
159
  },
160
  {
161
  "cell_type": "code",
162
- "execution_count": 5,
163
  "id": "d2752fb9-736e-4999-b796-f50925dd535e",
164
  "metadata": {},
165
  "outputs": [
@@ -171,7 +174,7 @@
171
  "PILImage mode=RGB size=173x192"
172
  ]
173
  },
174
- "execution_count": 5,
175
  "metadata": {},
176
  "output_type": "execute_result"
177
  }
@@ -179,6 +182,7 @@
179
  "source": [
180
  "im = PILImage.create(\"sunflower.jpg\")\n",
181
  "im.thumbnail((192,192))\n",
 
182
  "im"
183
  ]
184
  },
@@ -189,12 +193,13 @@
189
  "metadata": {},
190
  "outputs": [],
191
  "source": [
192
- "learn = load_learner(\"flower_id_export.pkl\")\n"
 
193
  ]
194
  },
195
  {
196
  "cell_type": "code",
197
- "execution_count": 16,
198
  "id": "a3eda266-632e-4c58-acf9-8cbcab764cdf",
199
  "metadata": {},
200
  "outputs": [
@@ -242,7 +247,7 @@
242
  },
243
  {
244
  "cell_type": "code",
245
- "execution_count": 15,
246
  "id": "78e26b4b-703c-47a6-9711-a7b433ffdbe3",
247
  "metadata": {},
248
  "outputs": [
@@ -252,7 +257,7 @@
252
  "['Hellebore flowers', 'Peoneis flowers', 'Rose flowers', 'Sunflower']"
253
  ]
254
  },
255
- "execution_count": 15,
256
  "metadata": {},
257
  "output_type": "execute_result"
258
  }
@@ -264,20 +269,20 @@
264
  },
265
  {
266
  "cell_type": "code",
267
- "execution_count": 23,
268
  "id": "56aff529-c0f3-4ded-80e5-a06a2d12346c",
269
  "metadata": {},
270
  "outputs": [
271
  {
272
  "data": {
273
  "text/plain": [
274
- "{'Hellebore flowers': 4.385266493045492e-06,\n",
275
- " 'Peoneis flowers': 2.3386392058455385e-06,\n",
276
- " 'Rose flowers': 1.7962941001314903e-06,\n",
277
- " 'Sunflower': 0.9999915361404419}"
278
  ]
279
  },
280
- "execution_count": 23,
281
  "metadata": {},
282
  "output_type": "execute_result"
283
  }
@@ -289,17 +294,20 @@
289
  },
290
  {
291
  "cell_type": "code",
292
- "execution_count": 22,
293
  "id": "67cbf81d-95d8-4f8c-9101-f2efb175b578",
294
  "metadata": {},
295
  "outputs": [
296
  {
297
  "data": {
298
  "text/plain": [
299
- "{}"
 
 
 
300
  ]
301
  },
302
- "execution_count": 22,
303
  "metadata": {},
304
  "output_type": "execute_result"
305
  }
@@ -310,9 +318,168 @@
310
  },
311
  {
312
  "cell_type": "code",
313
- "execution_count": null,
314
  "id": "669444a6-01e1-4dcc-a314-18580ae3d6c5",
315
  "metadata": {},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  "outputs": [],
317
  "source": []
318
  }
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": 1,
6
  "id": "c31ed028-ddf3-4c13-8049-1b67bf184a98",
7
  "metadata": {},
8
  "outputs": [
 
31
  "Collecting httpx (from gradio)\n",
32
  " Obtaining dependency information for httpx from https://files.pythonhosted.org/packages/33/0d/d9ce469af019741c8999711d36b270ff992ceb1a0293f73f9f34fdf131e9/httpx-0.25.0-py3-none-any.whl.metadata\n",
33
  " Downloading httpx-0.25.0-py3-none-any.whl.metadata (7.6 kB)\n",
34
+ "Requirement already satisfied: huggingface-hub>=0.14.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (0.17.3)\n",
35
+ "Requirement already satisfied: importlib-resources<7.0,>=1.3 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (6.1.0)\n",
36
+ "Requirement already satisfied: jinja2<4.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (3.1.2)\n",
37
+ "Requirement already satisfied: markupsafe~=2.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (2.1.3)\n",
38
+ "Requirement already satisfied: matplotlib~=3.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (3.8.0)\n",
39
+ "Requirement already satisfied: numpy~=1.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (1.26.0)\n",
40
  "Collecting orjson~=3.0 (from gradio)\n",
41
  " Obtaining dependency information for orjson~=3.0 from https://files.pythonhosted.org/packages/f4/66/d13cb488f5e74d603ebeb0b7b5032a81462d76d0b197a7b2002843ca1055/orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata\n",
42
  " Downloading orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (49 kB)\n",
43
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.3/49.3 kB\u001b[0m \u001b[31m1.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
44
+ "\u001b[?25hRequirement already satisfied: packaging in /root/mambaforge/lib/python3.10/site-packages (from gradio) (23.1)\n",
45
+ "Requirement already satisfied: pandas<3.0,>=1.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (2.1.1)\n",
46
+ "Requirement already satisfied: pillow<11.0,>=8.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (10.0.1)\n",
47
+ "Requirement already satisfied: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (2.4.2)\n",
48
  "Collecting pydub (from gradio)\n",
49
  " Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
50
  "Collecting python-multipart (from gradio)\n",
51
  " Downloading python_multipart-0.0.6-py3-none-any.whl (45 kB)\n",
52
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━��━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m485.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m \u001b[36m0:00:01\u001b[0m\n",
53
+ "\u001b[?25hRequirement already satisfied: pyyaml<7.0,>=5.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (6.0.1)\n",
54
+ "Requirement already satisfied: requests~=2.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (2.31.0)\n",
55
  "Collecting semantic-version~=2.0 (from gradio)\n",
56
  " Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n",
57
+ "Requirement already satisfied: typing-extensions~=4.0 in /root/mambaforge/lib/python3.10/site-packages (from gradio) (4.8.0)\n",
58
  "Collecting uvicorn>=0.14.0 (from gradio)\n",
59
  " Obtaining dependency information for uvicorn>=0.14.0 from https://files.pythonhosted.org/packages/79/96/b0882a1c3f7ef3dd86879e041212ae5b62b4bd352320889231cc735a8e8f/uvicorn-0.23.2-py3-none-any.whl.metadata\n",
60
  " Downloading uvicorn-0.23.2-py3-none-any.whl.metadata (6.2 kB)\n",
61
  "Collecting websockets<12.0,>=10.0 (from gradio)\n",
62
  " 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",
63
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m737.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
64
+ "\u001b[?25hRequirement already satisfied: fsspec in /root/mambaforge/lib/python3.10/site-packages (from gradio-client==0.6.1->gradio) (2023.10.0)\n",
65
+ "Requirement already satisfied: jsonschema>=3.0 in /root/mambaforge/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (4.19.1)\n",
66
+ "Requirement already satisfied: toolz in /root/mambaforge/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.0)\n",
67
+ "Requirement already satisfied: filelock in /root/mambaforge/lib/python3.10/site-packages (from huggingface-hub>=0.14.0->gradio) (3.12.4)\n",
68
+ "Requirement already satisfied: tqdm>=4.42.1 in /root/mambaforge/lib/python3.10/site-packages (from huggingface-hub>=0.14.0->gradio) (4.66.1)\n",
69
+ "Requirement already satisfied: contourpy>=1.0.1 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.1.1)\n",
70
+ "Requirement already satisfied: cycler>=0.10 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (0.12.1)\n",
71
+ "Requirement already satisfied: fonttools>=4.22.0 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (4.43.1)\n",
72
+ "Requirement already satisfied: kiwisolver>=1.0.1 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\n",
73
+ "Requirement already satisfied: pyparsing>=2.3.1 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (3.1.1)\n",
74
+ "Requirement already satisfied: python-dateutil>=2.7 in /root/mambaforge/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (2.8.2)\n",
75
+ "Requirement already satisfied: pytz>=2020.1 in /root/mambaforge/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3.post1)\n",
76
+ "Requirement already satisfied: tzdata>=2022.1 in /root/mambaforge/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3)\n",
77
+ "Requirement already satisfied: annotated-types>=0.4.0 in /root/mambaforge/lib/python3.10/site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4->gradio) (0.6.0)\n",
78
+ "Requirement already satisfied: pydantic-core==2.10.1 in /root/mambaforge/lib/python3.10/site-packages (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4->gradio) (2.10.1)\n",
79
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /root/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (3.2.0)\n",
80
+ "Requirement already satisfied: idna<4,>=2.5 in /root/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (3.4)\n",
81
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /root/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (2.0.4)\n",
82
+ "Requirement already satisfied: certifi>=2017.4.17 in /root/mambaforge/lib/python3.10/site-packages (from requests~=2.0->gradio) (2023.7.22)\n",
83
+ "Requirement already satisfied: click>=7.0 in /root/mambaforge/lib/python3.10/site-packages (from uvicorn>=0.14.0->gradio) (8.1.7)\n",
84
  "Collecting h11>=0.8 (from uvicorn>=0.14.0->gradio)\n",
85
  " Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n",
86
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m973.6 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:--:--\u001b[0m\n",
87
  "\u001b[?25hCollecting anyio<4.0.0,>=3.7.1 (from fastapi->gradio)\n",
88
  " Obtaining dependency information for anyio<4.0.0,>=3.7.1 from https://files.pythonhosted.org/packages/19/24/44299477fe7dcc9cb58d0a57d5a7588d6af2ff403fdd2d47a246c91a3246/anyio-3.7.1-py3-none-any.whl.metadata\n",
89
  " Downloading anyio-3.7.1-py3-none-any.whl.metadata (4.7 kB)\n",
 
93
  "Collecting httpcore<0.19.0,>=0.18.0 (from httpx->gradio)\n",
94
  " Obtaining dependency information for httpcore<0.19.0,>=0.18.0 from https://files.pythonhosted.org/packages/ac/97/724afbb7925339f6214bf1fdb5714d1a462690466832bf8fb3fd497649f1/httpcore-0.18.0-py3-none-any.whl.metadata\n",
95
  " Downloading httpcore-0.18.0-py3-none-any.whl.metadata (18 kB)\n",
96
+ "Requirement already satisfied: sniffio in /root/mambaforge/lib/python3.10/site-packages (from httpx->gradio) (1.3.0)\n",
97
+ "Requirement already satisfied: exceptiongroup in /root/mambaforge/lib/python3.10/site-packages (from anyio<4.0.0,>=3.7.1->fastapi->gradio) (1.1.3)\n",
98
+ "Requirement already satisfied: attrs>=22.2.0 in /root/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.1.0)\n",
99
+ "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /root/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.7.1)\n",
100
+ "Requirement already satisfied: referencing>=0.28.4 in /root/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.30.2)\n",
101
+ "Requirement already satisfied: rpds-py>=0.7.1 in /root/mambaforge/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.10.6)\n",
102
+ "Requirement already satisfied: six>=1.5 in /root/mambaforge/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\n",
103
  "Downloading gradio-3.50.2-py3-none-any.whl (20.3 MB)\n",
104
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m20.3/20.3 MB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m0m\n",
105
  "\u001b[?25hDownloading gradio_client-0.6.1-py3-none-any.whl (299 kB)\n",
106
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m299.2/299.2 kB\u001b[0m \u001b[31m1.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
107
  "\u001b[?25hDownloading aiofiles-23.2.1-py3-none-any.whl (15 kB)\n",
108
  "Downloading altair-5.1.2-py3-none-any.whl (516 kB)\n",
109
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m516.2/516.2 kB\u001b[0m \u001b[31m870.8 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
110
  "\u001b[?25hDownloading orjson-3.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138 kB)\n",
111
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m138.7/138.7 kB\u001b[0m \u001b[31m969.4 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m \u001b[36m0:00:01\u001b[0mm\n",
112
  "\u001b[?25hDownloading uvicorn-0.23.2-py3-none-any.whl (59 kB)\n",
113
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m59.5/59.5 kB\u001b[0m \u001b[31m1.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
114
  "\u001b[?25hDownloading fastapi-0.104.0-py3-none-any.whl (92 kB)\n",
115
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m92.9/92.9 kB\u001b[0m \u001b[31m759.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\u001b[36m0:00:01\u001b[0m\n",
116
  "\u001b[?25hDownloading httpx-0.25.0-py3-none-any.whl (75 kB)\n",
117
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.7/75.7 kB\u001b[0m \u001b[31m474.5 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
118
  "\u001b[?25hDownloading anyio-3.7.1-py3-none-any.whl (80 kB)\n",
119
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m80.9/80.9 kB\u001b[0m \u001b[31m793.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
120
  "\u001b[?25hDownloading httpcore-0.18.0-py3-none-any.whl (76 kB)\n",
121
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m76.0/76.0 kB\u001b[0m \u001b[31m675.4 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
122
  "\u001b[?25hDownloading starlette-0.27.0-py3-none-any.whl (66 kB)\n",
123
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m67.0/67.0 kB\u001b[0m \u001b[31m785.8 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
124
  "\u001b[?25hBuilding wheels for collected packages: ffmpy\n",
125
  " Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n",
126
+ "\u001b[?25h Created wheel for ffmpy: filename=ffmpy-0.3.1-py3-none-any.whl size=5579 sha256=e859e109fb7c92cb351720285b57433a58147d1c2d7b4e4233558a559711dae5\n",
127
+ " Stored in directory: /root/.cache/pip/wheels/01/a6/d1/1c0828c304a4283b2c1639a09ad86f83d7c487ef34c6b4a1bf\n",
128
  "Successfully built ffmpy\n",
129
  "Installing collected packages: pydub, ffmpy, websockets, semantic-version, python-multipart, orjson, h11, anyio, aiofiles, uvicorn, starlette, httpcore, httpx, fastapi, gradio-client, altair, gradio\n",
130
  " Attempting uninstall: anyio\n",
131
  " Found existing installation: anyio 4.0.0\n",
132
  " Uninstalling anyio-4.0.0:\n",
133
  " Successfully uninstalled anyio-4.0.0\n",
134
+ "Successfully installed aiofiles-23.2.1 altair-5.1.2 anyio-3.7.1 fastapi-0.104.0 ffmpy-0.3.1 gradio-3.50.2 gradio-client-0.6.1 h11-0.14.0 httpcore-0.18.0 httpx-0.25.0 orjson-3.9.9 pydub-0.25.1 python-multipart-0.0.6 semantic-version-2.10.0 starlette-0.27.0 uvicorn-0.23.2 websockets-11.0.3\n",
135
+ "\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n",
136
+ "\u001b[0m"
137
  ]
138
  }
139
  ],
 
144
  },
145
  {
146
  "cell_type": "code",
147
+ "execution_count": 2,
148
  "id": "61b17aee-d54d-45dd-970b-7f5e22c762e7",
149
  "metadata": {},
150
  "outputs": [],
151
  "source": [
152
+ "#|export\n",
153
  "from fastai.vision.all import *\n",
154
  "import gradio as gr"
155
  ]
 
162
  },
163
  {
164
  "cell_type": "code",
165
+ "execution_count": 3,
166
  "id": "d2752fb9-736e-4999-b796-f50925dd535e",
167
  "metadata": {},
168
  "outputs": [
 
174
  "PILImage mode=RGB size=173x192"
175
  ]
176
  },
177
+ "execution_count": 3,
178
  "metadata": {},
179
  "output_type": "execute_result"
180
  }
 
182
  "source": [
183
  "im = PILImage.create(\"sunflower.jpg\")\n",
184
  "im.thumbnail((192,192))\n",
185
+ "\n",
186
  "im"
187
  ]
188
  },
 
193
  "metadata": {},
194
  "outputs": [],
195
  "source": [
196
+ "#|export\n",
197
+ "learn = load_learner(\"export.pkl\")\n"
198
  ]
199
  },
200
  {
201
  "cell_type": "code",
202
+ "execution_count": 7,
203
  "id": "a3eda266-632e-4c58-acf9-8cbcab764cdf",
204
  "metadata": {},
205
  "outputs": [
 
247
  },
248
  {
249
  "cell_type": "code",
250
+ "execution_count": 8,
251
  "id": "78e26b4b-703c-47a6-9711-a7b433ffdbe3",
252
  "metadata": {},
253
  "outputs": [
 
257
  "['Hellebore flowers', 'Peoneis flowers', 'Rose flowers', 'Sunflower']"
258
  ]
259
  },
260
+ "execution_count": 8,
261
  "metadata": {},
262
  "output_type": "execute_result"
263
  }
 
269
  },
270
  {
271
  "cell_type": "code",
272
+ "execution_count": 9,
273
  "id": "56aff529-c0f3-4ded-80e5-a06a2d12346c",
274
  "metadata": {},
275
  "outputs": [
276
  {
277
  "data": {
278
  "text/plain": [
279
+ "{'Hellebore flowers': 7.141724154280382e-07,\n",
280
+ " 'Peoneis flowers': 1.4747066643394646e-06,\n",
281
+ " 'Rose flowers': 6.034231887497299e-07,\n",
282
+ " 'Sunflower': 0.9999972581863403}"
283
  ]
284
  },
285
+ "execution_count": 9,
286
  "metadata": {},
287
  "output_type": "execute_result"
288
  }
 
294
  },
295
  {
296
  "cell_type": "code",
297
+ "execution_count": 10,
298
  "id": "67cbf81d-95d8-4f8c-9101-f2efb175b578",
299
  "metadata": {},
300
  "outputs": [
301
  {
302
  "data": {
303
  "text/plain": [
304
+ "{'Hellebore flowers': 7.141724154280382e-07,\n",
305
+ " 'Peoneis flowers': 1.4747066643394646e-06,\n",
306
+ " 'Rose flowers': 6.034231887497299e-07,\n",
307
+ " 'Sunflower': 0.9999972581863403}"
308
  ]
309
  },
310
+ "execution_count": 10,
311
  "metadata": {},
312
  "output_type": "execute_result"
313
  }
 
318
  },
319
  {
320
  "cell_type": "code",
321
+ "execution_count": 17,
322
  "id": "669444a6-01e1-4dcc-a314-18580ae3d6c5",
323
  "metadata": {},
324
+ "outputs": [
325
+ {
326
+ "data": {
327
+ "text/html": [
328
+ "\n",
329
+ "<style>\n",
330
+ " /* Turns off some styling */\n",
331
+ " progress {\n",
332
+ " /* gets rid of default border in Firefox and Opera. */\n",
333
+ " border: none;\n",
334
+ " /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
335
+ " background-size: auto;\n",
336
+ " }\n",
337
+ " progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
338
+ " background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
339
+ " }\n",
340
+ " .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
341
+ " background: #F44336;\n",
342
+ " }\n",
343
+ "</style>\n"
344
+ ],
345
+ "text/plain": [
346
+ "<IPython.core.display.HTML object>"
347
+ ]
348
+ },
349
+ "metadata": {},
350
+ "output_type": "display_data"
351
+ },
352
+ {
353
+ "data": {
354
+ "text/html": [],
355
+ "text/plain": [
356
+ "<IPython.core.display.HTML object>"
357
+ ]
358
+ },
359
+ "metadata": {},
360
+ "output_type": "display_data"
361
+ },
362
+ {
363
+ "data": {
364
+ "text/plain": [
365
+ "{'Hellebore flowers': 7.141724154280382e-07,\n",
366
+ " 'Peoneis flowers': 1.4747066643394646e-06,\n",
367
+ " 'Rose flowers': 6.034231887497299e-07,\n",
368
+ " 'Sunflower': 0.9999972581863403}"
369
+ ]
370
+ },
371
+ "execution_count": 17,
372
+ "metadata": {},
373
+ "output_type": "execute_result"
374
+ }
375
+ ],
376
+ "source": [
377
+ "#|export\n",
378
+ "def classify_image(img):\n",
379
+ " predict, idx, probs = learn.predict(img)\n",
380
+ " categories = learn.dls.vocab\n",
381
+ " return dict(zip(categories,map(float,probs)))\n",
382
+ "\n"
383
+ ]
384
+ },
385
+ {
386
+ "cell_type": "code",
387
+ "execution_count": 18,
388
+ "id": "1020b745-5352-4874-92d2-a1ecdedf1e20",
389
+ "metadata": {},
390
+ "outputs": [
391
+ {
392
+ "name": "stderr",
393
+ "output_type": "stream",
394
+ "text": [
395
+ "/tmp/ipykernel_297/535013132.py:2: GradioDeprecationWarning: Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components\n",
396
+ " image = gr.inputs.Image(shape=(192,192))\n",
397
+ "/tmp/ipykernel_297/535013132.py:2: GradioDeprecationWarning: `optional` parameter is deprecated, and it has no effect\n",
398
+ " image = gr.inputs.Image(shape=(192,192))\n",
399
+ "/tmp/ipykernel_297/535013132.py:3: GradioDeprecationWarning: Usage of gradio.outputs is deprecated, and will not be supported in the future, please import your components from gradio.components\n",
400
+ " label = gr.outputs.Label()\n",
401
+ "/tmp/ipykernel_297/535013132.py:3: GradioUnusedKwargWarning: You have unused kwarg parameters in Label, please remove them: {'type': 'auto'}\n",
402
+ " label = gr.outputs.Label()\n"
403
+ ]
404
+ },
405
+ {
406
+ "name": "stdout",
407
+ "output_type": "stream",
408
+ "text": [
409
+ "Running on local URL: http://127.0.0.1:7862\n",
410
+ "\n",
411
+ "To create a public link, set `share=True` in `launch()`.\n"
412
+ ]
413
+ },
414
+ {
415
+ "data": {
416
+ "text/plain": []
417
+ },
418
+ "execution_count": 18,
419
+ "metadata": {},
420
+ "output_type": "execute_result"
421
+ }
422
+ ],
423
+ "source": [
424
+ "#|export\n",
425
+ "image = gr.inputs.Image(shape=(192,192))\n",
426
+ "label = gr.outputs.Label()\n",
427
+ "examples = [\"sunflower.jpg\",\"Peonies.jpeg\",\"Hellebore.jpg\",\"Rose.jpg\"]\n",
428
+ "\n",
429
+ "intf = gr.Interface(fn=classify_image, inputs=image,outputs=label,examples=examples)\n",
430
+ "intf.launch(inline=False)"
431
+ ]
432
+ },
433
+ {
434
+ "cell_type": "code",
435
+ "execution_count": 21,
436
+ "id": "87c95918-a681-4c3f-9882-b6d80d586444",
437
+ "metadata": {},
438
+ "outputs": [
439
+ {
440
+ "ename": "ImportError",
441
+ "evalue": "cannot import name 'notebook2script' from 'nbdev.export' (/root/mambaforge/lib/python3.10/site-packages/nbdev/export.py)",
442
+ "output_type": "error",
443
+ "traceback": [
444
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
445
+ "\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
446
+ "Cell \u001b[0;32mIn[21], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mnbdev\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mexport\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m notebook2script\n\u001b[1;32m 2\u001b[0m notebook2script(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtesting.ipynb\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
447
+ "\u001b[0;31mImportError\u001b[0m: cannot import name 'notebook2script' from 'nbdev.export' (/root/mambaforge/lib/python3.10/site-packages/nbdev/export.py)"
448
+ ]
449
+ }
450
+ ],
451
+ "source": [
452
+ "from nbdev.export import notebook2script\n",
453
+ "notebook2script('testing.ipynb')"
454
+ ]
455
+ },
456
+ {
457
+ "cell_type": "code",
458
+ "execution_count": 22,
459
+ "id": "d9c38fb9-56a7-4646-bec5-e3055625e668",
460
+ "metadata": {},
461
+ "outputs": [
462
+ {
463
+ "name": "stderr",
464
+ "output_type": "stream",
465
+ "text": [
466
+ "/root/mambaforge/lib/python3.10/site-packages/nbdev/export.py:54: UserWarning: Notebook 'testing.ipynb' uses `#|export` without `#|default_exp` cell.\n",
467
+ "Note nbdev2 no longer supports nbdev1 syntax. Run `nbdev_migrate` to upgrade.\n",
468
+ "See https://nbdev.fast.ai/getting_started.html for more information.\n",
469
+ " warn(f\"Notebook '{nbname}' uses `#|export` without `#|default_exp` cell.\\n\"\n"
470
+ ]
471
+ }
472
+ ],
473
+ "source": [
474
+ "import nbdev\n",
475
+ "nbdev.export.nb_export('testing.ipynb', 'newapp')"
476
+ ]
477
+ },
478
+ {
479
+ "cell_type": "code",
480
+ "execution_count": null,
481
+ "id": "78cd66aa-f88b-4ec1-a006-741599774cb5",
482
+ "metadata": {},
483
  "outputs": [],
484
  "source": []
485
  }