Spaces:
Sleeping
Sleeping
Upload 13 files
Browse files- Abra1.png +0 -0
- Abra2.png +0 -0
- Abra3.jpg +0 -0
- Beedrill1.jpg +0 -0
- Beedrill2.jpg +0 -0
- Beedrill3.png +0 -0
- Pikachu1.png +0 -0
- Pikachu2.jpg +0 -0
- Pikachu3.png +0 -0
- app.ipynb +342 -0
- mabel-poke.zip +3 -0
- mabs_task2.ipynb +0 -0
Abra1.png
ADDED
![]() |
Abra2.png
ADDED
![]() |
Abra3.jpg
ADDED
![]() |
Beedrill1.jpg
ADDED
![]() |
Beedrill2.jpg
ADDED
![]() |
Beedrill3.png
ADDED
![]() |
Pikachu1.png
ADDED
![]() |
Pikachu2.jpg
ADDED
![]() |
Pikachu3.png
ADDED
![]() |
app.ipynb
ADDED
@@ -0,0 +1,342 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 2,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [
|
8 |
+
{
|
9 |
+
"name": "stdout",
|
10 |
+
"output_type": "stream",
|
11 |
+
"text": [
|
12 |
+
"Collecting gradio\n",
|
13 |
+
" Downloading gradio-4.31.4-py3-none-any.whl.metadata (15 kB)\n",
|
14 |
+
"Collecting aiofiles<24.0,>=22.0 (from gradio)\n",
|
15 |
+
" Using cached aiofiles-23.2.1-py3-none-any.whl.metadata (9.7 kB)\n",
|
16 |
+
"Collecting altair<6.0,>=4.2.0 (from gradio)\n",
|
17 |
+
" Using cached altair-5.3.0-py3-none-any.whl.metadata (9.2 kB)\n",
|
18 |
+
"Collecting fastapi (from gradio)\n",
|
19 |
+
" Downloading fastapi-0.111.0-py3-none-any.whl.metadata (25 kB)\n",
|
20 |
+
"Collecting ffmpy (from gradio)\n",
|
21 |
+
" Using cached ffmpy-0.3.2.tar.gz (5.5 kB)\n",
|
22 |
+
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
|
23 |
+
"\u001b[?25hCollecting gradio-client==0.16.4 (from gradio)\n",
|
24 |
+
" Downloading gradio_client-0.16.4-py3-none-any.whl.metadata (7.1 kB)\n",
|
25 |
+
"Collecting httpx>=0.24.1 (from gradio)\n",
|
26 |
+
" Using cached httpx-0.27.0-py3-none-any.whl.metadata (7.2 kB)\n",
|
27 |
+
"Collecting huggingface-hub>=0.19.3 (from gradio)\n",
|
28 |
+
" Downloading huggingface_hub-0.23.0-py3-none-any.whl.metadata (12 kB)\n",
|
29 |
+
"Requirement already satisfied: importlib-resources<7.0,>=1.3 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from gradio) (6.4.0)\n",
|
30 |
+
"Collecting jinja2<4.0 (from gradio)\n",
|
31 |
+
" Downloading jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)\n",
|
32 |
+
"Requirement already satisfied: markupsafe~=2.0 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from gradio) (2.1.5)\n",
|
33 |
+
"Requirement already satisfied: matplotlib~=3.0 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from gradio) (3.9.0)\n",
|
34 |
+
"Requirement already satisfied: numpy~=1.0 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from gradio) (1.26.4)\n",
|
35 |
+
"Collecting orjson~=3.0 (from gradio)\n",
|
36 |
+
" Downloading orjson-3.10.3-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl.metadata (49 kB)\n",
|
37 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m49.7/49.7 kB\u001b[0m \u001b[31m2.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
38 |
+
"\u001b[?25hRequirement already satisfied: packaging in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from gradio) (24.0)\n",
|
39 |
+
"Collecting pandas<3.0,>=1.0 (from gradio)\n",
|
40 |
+
" Downloading pandas-2.2.2-cp312-cp312-macosx_11_0_arm64.whl.metadata (19 kB)\n",
|
41 |
+
"Requirement already satisfied: pillow<11.0,>=8.0 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from gradio) (10.3.0)\n",
|
42 |
+
"Collecting pydantic>=2.0 (from gradio)\n",
|
43 |
+
" Using cached pydantic-2.7.1-py3-none-any.whl.metadata (107 kB)\n",
|
44 |
+
"Collecting pydub (from gradio)\n",
|
45 |
+
" Using cached pydub-0.25.1-py2.py3-none-any.whl.metadata (1.4 kB)\n",
|
46 |
+
"Collecting python-multipart>=0.0.9 (from gradio)\n",
|
47 |
+
" Using cached python_multipart-0.0.9-py3-none-any.whl.metadata (2.5 kB)\n",
|
48 |
+
"Collecting pyyaml<7.0,>=5.0 (from gradio)\n",
|
49 |
+
" Downloading PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl.metadata (2.1 kB)\n",
|
50 |
+
"Collecting ruff>=0.2.2 (from gradio)\n",
|
51 |
+
" Downloading ruff-0.4.4-py3-none-macosx_11_0_arm64.whl.metadata (23 kB)\n",
|
52 |
+
"Collecting semantic-version~=2.0 (from gradio)\n",
|
53 |
+
" Using cached semantic_version-2.10.0-py2.py3-none-any.whl.metadata (9.7 kB)\n",
|
54 |
+
"Collecting tomlkit==0.12.0 (from gradio)\n",
|
55 |
+
" Using cached tomlkit-0.12.0-py3-none-any.whl.metadata (2.7 kB)\n",
|
56 |
+
"Collecting typer<1.0,>=0.12 (from gradio)\n",
|
57 |
+
" Downloading typer-0.12.3-py3-none-any.whl.metadata (15 kB)\n",
|
58 |
+
"Requirement already satisfied: typing-extensions~=4.0 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from gradio) (4.11.0)\n",
|
59 |
+
"Requirement already satisfied: urllib3~=2.0 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from gradio) (2.2.1)\n",
|
60 |
+
"Collecting uvicorn>=0.14.0 (from gradio)\n",
|
61 |
+
" Using cached uvicorn-0.29.0-py3-none-any.whl.metadata (6.3 kB)\n",
|
62 |
+
"Requirement already satisfied: fsspec in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from gradio-client==0.16.4->gradio) (2024.5.0)\n",
|
63 |
+
"Collecting websockets<12.0,>=10.0 (from gradio-client==0.16.4->gradio)\n",
|
64 |
+
" Downloading websockets-11.0.3-py3-none-any.whl.metadata (6.6 kB)\n",
|
65 |
+
"Collecting jsonschema>=3.0 (from altair<6.0,>=4.2.0->gradio)\n",
|
66 |
+
" Downloading jsonschema-4.22.0-py3-none-any.whl.metadata (8.2 kB)\n",
|
67 |
+
"Collecting toolz (from altair<6.0,>=4.2.0->gradio)\n",
|
68 |
+
" Using cached toolz-0.12.1-py3-none-any.whl.metadata (5.1 kB)\n",
|
69 |
+
"Collecting anyio (from httpx>=0.24.1->gradio)\n",
|
70 |
+
" Using cached anyio-4.3.0-py3-none-any.whl.metadata (4.6 kB)\n",
|
71 |
+
"Requirement already satisfied: certifi in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from httpx>=0.24.1->gradio) (2024.2.2)\n",
|
72 |
+
"Collecting httpcore==1.* (from httpx>=0.24.1->gradio)\n",
|
73 |
+
" Using cached httpcore-1.0.5-py3-none-any.whl.metadata (20 kB)\n",
|
74 |
+
"Requirement already satisfied: idna in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from httpx>=0.24.1->gradio) (3.7)\n",
|
75 |
+
"Collecting sniffio (from httpx>=0.24.1->gradio)\n",
|
76 |
+
" Using cached sniffio-1.3.1-py3-none-any.whl.metadata (3.9 kB)\n",
|
77 |
+
"Collecting h11<0.15,>=0.13 (from httpcore==1.*->httpx>=0.24.1->gradio)\n",
|
78 |
+
" Using cached h11-0.14.0-py3-none-any.whl.metadata (8.2 kB)\n",
|
79 |
+
"Collecting filelock (from huggingface-hub>=0.19.3->gradio)\n",
|
80 |
+
" Downloading filelock-3.14.0-py3-none-any.whl.metadata (2.8 kB)\n",
|
81 |
+
"Requirement already satisfied: requests in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from huggingface-hub>=0.19.3->gradio) (2.32.0)\n",
|
82 |
+
"Requirement already satisfied: tqdm>=4.42.1 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from huggingface-hub>=0.19.3->gradio) (4.66.4)\n",
|
83 |
+
"Requirement already satisfied: contourpy>=1.0.1 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from matplotlib~=3.0->gradio) (1.2.1)\n",
|
84 |
+
"Requirement already satisfied: cycler>=0.10 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from matplotlib~=3.0->gradio) (0.12.1)\n",
|
85 |
+
"Requirement already satisfied: fonttools>=4.22.0 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from matplotlib~=3.0->gradio) (4.51.0)\n",
|
86 |
+
"Requirement already satisfied: kiwisolver>=1.3.1 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\n",
|
87 |
+
"Requirement already satisfied: pyparsing>=2.3.1 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from matplotlib~=3.0->gradio) (3.1.2)\n",
|
88 |
+
"Requirement already satisfied: python-dateutil>=2.7 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from matplotlib~=3.0->gradio) (2.9.0.post0)\n",
|
89 |
+
"Collecting pytz>=2020.1 (from pandas<3.0,>=1.0->gradio)\n",
|
90 |
+
" Downloading pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)\n",
|
91 |
+
"Collecting tzdata>=2022.7 (from pandas<3.0,>=1.0->gradio)\n",
|
92 |
+
" Downloading tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)\n",
|
93 |
+
"Collecting annotated-types>=0.4.0 (from pydantic>=2.0->gradio)\n",
|
94 |
+
" Downloading annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB)\n",
|
95 |
+
"Collecting pydantic-core==2.18.2 (from pydantic>=2.0->gradio)\n",
|
96 |
+
" Downloading pydantic_core-2.18.2-cp312-cp312-macosx_11_0_arm64.whl.metadata (6.5 kB)\n",
|
97 |
+
"Requirement already satisfied: click>=8.0.0 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from typer<1.0,>=0.12->gradio) (8.1.7)\n",
|
98 |
+
"Collecting shellingham>=1.3.0 (from typer<1.0,>=0.12->gradio)\n",
|
99 |
+
" Using cached shellingham-1.5.4-py2.py3-none-any.whl.metadata (3.5 kB)\n",
|
100 |
+
"Requirement already satisfied: rich>=10.11.0 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from typer<1.0,>=0.12->gradio) (13.7.1)\n",
|
101 |
+
"Collecting starlette<0.38.0,>=0.37.2 (from fastapi->gradio)\n",
|
102 |
+
" Using cached starlette-0.37.2-py3-none-any.whl.metadata (5.9 kB)\n",
|
103 |
+
"Collecting fastapi-cli>=0.0.2 (from fastapi->gradio)\n",
|
104 |
+
" Downloading fastapi_cli-0.0.4-py3-none-any.whl.metadata (7.0 kB)\n",
|
105 |
+
"Collecting ujson!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,>=4.0.1 (from fastapi->gradio)\n",
|
106 |
+
" Downloading ujson-5.10.0-cp312-cp312-macosx_11_0_arm64.whl.metadata (9.3 kB)\n",
|
107 |
+
"Collecting email_validator>=2.0.0 (from fastapi->gradio)\n",
|
108 |
+
" Downloading email_validator-2.1.1-py3-none-any.whl.metadata (26 kB)\n",
|
109 |
+
"Collecting dnspython>=2.0.0 (from email_validator>=2.0.0->fastapi->gradio)\n",
|
110 |
+
" Downloading dnspython-2.6.1-py3-none-any.whl.metadata (5.8 kB)\n",
|
111 |
+
"Collecting attrs>=22.2.0 (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio)\n",
|
112 |
+
" Downloading attrs-23.2.0-py3-none-any.whl.metadata (9.5 kB)\n",
|
113 |
+
"Collecting jsonschema-specifications>=2023.03.6 (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio)\n",
|
114 |
+
" Downloading jsonschema_specifications-2023.12.1-py3-none-any.whl.metadata (3.0 kB)\n",
|
115 |
+
"Collecting referencing>=0.28.4 (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio)\n",
|
116 |
+
" Downloading referencing-0.35.1-py3-none-any.whl.metadata (2.8 kB)\n",
|
117 |
+
"Collecting rpds-py>=0.7.1 (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio)\n",
|
118 |
+
" Downloading rpds_py-0.18.1-cp312-cp312-macosx_11_0_arm64.whl.metadata (4.1 kB)\n",
|
119 |
+
"Requirement already satisfied: six>=1.5 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\n",
|
120 |
+
"Requirement already satisfied: markdown-it-py>=2.2.0 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from rich>=10.11.0->typer<1.0,>=0.12->gradio) (3.0.0)\n",
|
121 |
+
"Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from rich>=10.11.0->typer<1.0,>=0.12->gradio) (2.18.0)\n",
|
122 |
+
"Collecting httptools>=0.5.0 (from uvicorn[standard]>=0.12.0->fastapi->gradio)\n",
|
123 |
+
" Downloading httptools-0.6.1-cp312-cp312-macosx_10_9_universal2.whl.metadata (3.6 kB)\n",
|
124 |
+
"Collecting python-dotenv>=0.13 (from uvicorn[standard]>=0.12.0->fastapi->gradio)\n",
|
125 |
+
" Using cached python_dotenv-1.0.1-py3-none-any.whl.metadata (23 kB)\n",
|
126 |
+
"Collecting uvloop!=0.15.0,!=0.15.1,>=0.14.0 (from uvicorn[standard]>=0.12.0->fastapi->gradio)\n",
|
127 |
+
" Downloading uvloop-0.19.0-cp312-cp312-macosx_10_9_universal2.whl.metadata (4.9 kB)\n",
|
128 |
+
"Collecting watchfiles>=0.13 (from uvicorn[standard]>=0.12.0->fastapi->gradio)\n",
|
129 |
+
" Downloading watchfiles-0.21.0-cp312-cp312-macosx_11_0_arm64.whl.metadata (4.9 kB)\n",
|
130 |
+
"Requirement already satisfied: charset-normalizer<4,>=2 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from requests->huggingface-hub>=0.19.3->gradio) (3.3.2)\n",
|
131 |
+
"Requirement already satisfied: mdurl~=0.1 in /Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer<1.0,>=0.12->gradio) (0.1.2)\n",
|
132 |
+
"Downloading gradio-4.31.4-py3-none-any.whl (12.3 MB)\n",
|
133 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m12.3/12.3 MB\u001b[0m \u001b[31m4.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
134 |
+
"\u001b[?25hDownloading gradio_client-0.16.4-py3-none-any.whl (315 kB)\n",
|
135 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m315.9/315.9 kB\u001b[0m \u001b[31m4.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
136 |
+
"\u001b[?25hUsing cached tomlkit-0.12.0-py3-none-any.whl (37 kB)\n",
|
137 |
+
"Using cached aiofiles-23.2.1-py3-none-any.whl (15 kB)\n",
|
138 |
+
"Using cached altair-5.3.0-py3-none-any.whl (857 kB)\n",
|
139 |
+
"Using cached httpx-0.27.0-py3-none-any.whl (75 kB)\n",
|
140 |
+
"Using cached httpcore-1.0.5-py3-none-any.whl (77 kB)\n",
|
141 |
+
"Downloading huggingface_hub-0.23.0-py3-none-any.whl (401 kB)\n",
|
142 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m401.2/401.2 kB\u001b[0m \u001b[31m4.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
143 |
+
"\u001b[?25hDownloading jinja2-3.1.4-py3-none-any.whl (133 kB)\n",
|
144 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m133.3/133.3 kB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
145 |
+
"\u001b[?25hDownloading orjson-3.10.3-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl (253 kB)\n",
|
146 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m253.8/253.8 kB\u001b[0m \u001b[31m4.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
147 |
+
"\u001b[?25hDownloading pandas-2.2.2-cp312-cp312-macosx_11_0_arm64.whl (11.3 MB)\n",
|
148 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m11.3/11.3 MB\u001b[0m \u001b[31m4.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
149 |
+
"\u001b[?25hUsing cached pydantic-2.7.1-py3-none-any.whl (409 kB)\n",
|
150 |
+
"Downloading pydantic_core-2.18.2-cp312-cp312-macosx_11_0_arm64.whl (1.8 MB)\n",
|
151 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m1.8/1.8 MB\u001b[0m \u001b[31m4.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
152 |
+
"\u001b[?25hUsing cached python_multipart-0.0.9-py3-none-any.whl (22 kB)\n",
|
153 |
+
"Downloading PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl (165 kB)\n",
|
154 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m165.6/165.6 kB\u001b[0m \u001b[31m4.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m\n",
|
155 |
+
"\u001b[?25hDownloading ruff-0.4.4-py3-none-macosx_11_0_arm64.whl (8.0 MB)\n",
|
156 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m8.0/8.0 MB\u001b[0m \u001b[31m4.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
157 |
+
"\u001b[?25hUsing cached semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n",
|
158 |
+
"Downloading typer-0.12.3-py3-none-any.whl (47 kB)\n",
|
159 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m47.2/47.2 kB\u001b[0m \u001b[31m2.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
160 |
+
"\u001b[?25hUsing cached uvicorn-0.29.0-py3-none-any.whl (60 kB)\n",
|
161 |
+
"Downloading fastapi-0.111.0-py3-none-any.whl (91 kB)\n",
|
162 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m92.0/92.0 kB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
163 |
+
"\u001b[?25hUsing cached pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
|
164 |
+
"Downloading annotated_types-0.7.0-py3-none-any.whl (13 kB)\n",
|
165 |
+
"Downloading email_validator-2.1.1-py3-none-any.whl (30 kB)\n",
|
166 |
+
"Downloading fastapi_cli-0.0.4-py3-none-any.whl (9.5 kB)\n",
|
167 |
+
"Using cached h11-0.14.0-py3-none-any.whl (58 kB)\n",
|
168 |
+
"Downloading jsonschema-4.22.0-py3-none-any.whl (88 kB)\n",
|
169 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m88.3/88.3 kB\u001b[0m \u001b[31m3.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
170 |
+
"\u001b[?25hDownloading pytz-2024.1-py2.py3-none-any.whl (505 kB)\n",
|
171 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m505.5/505.5 kB\u001b[0m \u001b[31m4.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
172 |
+
"\u001b[?25hUsing cached shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)\n",
|
173 |
+
"Using cached starlette-0.37.2-py3-none-any.whl (71 kB)\n",
|
174 |
+
"Using cached anyio-4.3.0-py3-none-any.whl (85 kB)\n",
|
175 |
+
"Using cached sniffio-1.3.1-py3-none-any.whl (10 kB)\n",
|
176 |
+
"Downloading tzdata-2024.1-py2.py3-none-any.whl (345 kB)\n",
|
177 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m345.4/345.4 kB\u001b[0m \u001b[31m4.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
|
178 |
+
"\u001b[?25hDownloading ujson-5.10.0-cp312-cp312-macosx_11_0_arm64.whl (51 kB)\n",
|
179 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m51.8/51.8 kB\u001b[0m \u001b[31m3.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
180 |
+
"\u001b[?25hDownloading websockets-11.0.3-py3-none-any.whl (118 kB)\n",
|
181 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m118.1/118.1 kB\u001b[0m \u001b[31m4.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
182 |
+
"\u001b[?25hDownloading filelock-3.14.0-py3-none-any.whl (12 kB)\n",
|
183 |
+
"Using cached toolz-0.12.1-py3-none-any.whl (56 kB)\n",
|
184 |
+
"Downloading attrs-23.2.0-py3-none-any.whl (60 kB)\n",
|
185 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m60.8/60.8 kB\u001b[0m \u001b[31m3.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
186 |
+
"\u001b[?25hDownloading dnspython-2.6.1-py3-none-any.whl (307 kB)\n",
|
187 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m307.7/307.7 kB\u001b[0m \u001b[31m4.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
188 |
+
"\u001b[?25hDownloading httptools-0.6.1-cp312-cp312-macosx_10_9_universal2.whl (146 kB)\n",
|
189 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m146.4/146.4 kB\u001b[0m \u001b[31m3.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
190 |
+
"\u001b[?25hDownloading jsonschema_specifications-2023.12.1-py3-none-any.whl (18 kB)\n",
|
191 |
+
"Using cached python_dotenv-1.0.1-py3-none-any.whl (19 kB)\n",
|
192 |
+
"Downloading referencing-0.35.1-py3-none-any.whl (26 kB)\n",
|
193 |
+
"Downloading rpds_py-0.18.1-cp312-cp312-macosx_11_0_arm64.whl (323 kB)\n",
|
194 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m323.6/323.6 kB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
195 |
+
"\u001b[?25hDownloading uvloop-0.19.0-cp312-cp312-macosx_10_9_universal2.whl (1.4 MB)\n",
|
196 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m1.4/1.4 MB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
197 |
+
"\u001b[?25hDownloading watchfiles-0.21.0-cp312-cp312-macosx_11_0_arm64.whl (417 kB)\n",
|
198 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m417.3/417.3 kB\u001b[0m \u001b[31m4.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
|
199 |
+
"\u001b[?25hBuilding wheels for collected packages: ffmpy\n",
|
200 |
+
" Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n",
|
201 |
+
"\u001b[?25h Created wheel for ffmpy: filename=ffmpy-0.3.2-py3-none-any.whl size=5584 sha256=97651e6dbb547e6b91aabbc5543bdf57b24da837cbeae1b4a111522dc42924b5\n",
|
202 |
+
" Stored in directory: /Users/mabelang/Library/Caches/pip/wheels/8a/63/a8/fad16a1c5c990569a478f40782ce543788ddac224288008635\n",
|
203 |
+
"Successfully built ffmpy\n",
|
204 |
+
"Installing collected packages: pytz, pydub, ffmpy, websockets, uvloop, ujson, tzdata, toolz, tomlkit, sniffio, shellingham, semantic-version, ruff, rpds-py, pyyaml, python-multipart, python-dotenv, pydantic-core, orjson, jinja2, httptools, h11, filelock, dnspython, attrs, annotated-types, aiofiles, uvicorn, referencing, pydantic, pandas, huggingface-hub, httpcore, email_validator, anyio, watchfiles, typer, starlette, jsonschema-specifications, httpx, jsonschema, gradio-client, fastapi-cli, fastapi, altair, gradio\n",
|
205 |
+
"Successfully installed aiofiles-23.2.1 altair-5.3.0 annotated-types-0.7.0 anyio-4.3.0 attrs-23.2.0 dnspython-2.6.1 email_validator-2.1.1 fastapi-0.111.0 fastapi-cli-0.0.4 ffmpy-0.3.2 filelock-3.14.0 gradio-4.31.4 gradio-client-0.16.4 h11-0.14.0 httpcore-1.0.5 httptools-0.6.1 httpx-0.27.0 huggingface-hub-0.23.0 jinja2-3.1.4 jsonschema-4.22.0 jsonschema-specifications-2023.12.1 orjson-3.10.3 pandas-2.2.2 pydantic-2.7.1 pydantic-core-2.18.2 pydub-0.25.1 python-dotenv-1.0.1 python-multipart-0.0.9 pytz-2024.1 pyyaml-6.0.1 referencing-0.35.1 rpds-py-0.18.1 ruff-0.4.4 semantic-version-2.10.0 shellingham-1.5.4 sniffio-1.3.1 starlette-0.37.2 tomlkit-0.12.0 toolz-0.12.1 typer-0.12.3 tzdata-2024.1 ujson-5.10.0 uvicorn-0.29.0 uvloop-0.19.0 watchfiles-0.21.0 websockets-11.0.3\n",
|
206 |
+
"Note: you may need to restart the kernel to use updated packages.\n"
|
207 |
+
]
|
208 |
+
}
|
209 |
+
],
|
210 |
+
"source": [
|
211 |
+
"# pip install gradio"
|
212 |
+
]
|
213 |
+
},
|
214 |
+
{
|
215 |
+
"cell_type": "code",
|
216 |
+
"execution_count": 3,
|
217 |
+
"metadata": {},
|
218 |
+
"outputs": [
|
219 |
+
{
|
220 |
+
"name": "stderr",
|
221 |
+
"output_type": "stream",
|
222 |
+
"text": [
|
223 |
+
"/Users/mabelang/Documents/Z. AI apps/AI Task 2_Pokemon Classifier/.venv/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
|
224 |
+
" from .autonotebook import tqdm as notebook_tqdm\n"
|
225 |
+
]
|
226 |
+
}
|
227 |
+
],
|
228 |
+
"source": [
|
229 |
+
"import gradio as gr\n",
|
230 |
+
"import tensorflow as tf\n",
|
231 |
+
"import numpy as np\n",
|
232 |
+
"from PIL import Image"
|
233 |
+
]
|
234 |
+
},
|
235 |
+
{
|
236 |
+
"cell_type": "code",
|
237 |
+
"execution_count": 4,
|
238 |
+
"metadata": {},
|
239 |
+
"outputs": [],
|
240 |
+
"source": [
|
241 |
+
"model_path = \"mabel_transferlearning.keras\"\n",
|
242 |
+
"model = tf.keras.models.load_model(model_path)"
|
243 |
+
]
|
244 |
+
},
|
245 |
+
{
|
246 |
+
"cell_type": "code",
|
247 |
+
"execution_count": 8,
|
248 |
+
"metadata": {},
|
249 |
+
"outputs": [],
|
250 |
+
"source": [
|
251 |
+
"# Define the core prediction function\n",
|
252 |
+
"def predict_pokemons(image):\n",
|
253 |
+
" # Preprocess image\n",
|
254 |
+
" print(type(image))\n",
|
255 |
+
" image = Image.fromarray(image.astype('uint8')) # Convert numpy array to PIL image\n",
|
256 |
+
" image = image.resize((150, 150)) #resize the image to 28x28 and converts it to gray scale\n",
|
257 |
+
" image = np.array(image)\n",
|
258 |
+
" image = np.expand_dims(image, axis=0) # same as image[None, ...]\n",
|
259 |
+
" \n",
|
260 |
+
" # Predict\n",
|
261 |
+
" prediction = model.predict(image)\n",
|
262 |
+
" \n",
|
263 |
+
" # Apply sigmoid to get probabilities\n",
|
264 |
+
" prediction_prob = tf.sigmoid(prediction).numpy()\n",
|
265 |
+
"\n",
|
266 |
+
" p_Abra = round(prediction_prob[0][0], 2)\n",
|
267 |
+
" p_Pikachu = round(prediction_prob[0][1], 2)\n",
|
268 |
+
" p_Beedrill = round(prediction_prob[0][2], 2)\n",
|
269 |
+
"\n",
|
270 |
+
" return{'Abra': p_Abra, 'Pikachu': p_Pikachu, 'Beedrill': p_Beedrill}"
|
271 |
+
]
|
272 |
+
},
|
273 |
+
{
|
274 |
+
"cell_type": "code",
|
275 |
+
"execution_count": 11,
|
276 |
+
"metadata": {},
|
277 |
+
"outputs": [
|
278 |
+
{
|
279 |
+
"name": "stdout",
|
280 |
+
"output_type": "stream",
|
281 |
+
"text": [
|
282 |
+
"Running on local URL: http://127.0.0.1:7863\n",
|
283 |
+
"\n",
|
284 |
+
"To create a public link, set `share=True` in `launch()`.\n"
|
285 |
+
]
|
286 |
+
},
|
287 |
+
{
|
288 |
+
"data": {
|
289 |
+
"text/html": [
|
290 |
+
"<div><iframe src=\"http://127.0.0.1:7863/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
|
291 |
+
],
|
292 |
+
"text/plain": [
|
293 |
+
"<IPython.core.display.HTML object>"
|
294 |
+
]
|
295 |
+
},
|
296 |
+
"metadata": {},
|
297 |
+
"output_type": "display_data"
|
298 |
+
},
|
299 |
+
{
|
300 |
+
"data": {
|
301 |
+
"text/plain": []
|
302 |
+
},
|
303 |
+
"execution_count": 11,
|
304 |
+
"metadata": {},
|
305 |
+
"output_type": "execute_result"
|
306 |
+
}
|
307 |
+
],
|
308 |
+
"source": [
|
309 |
+
"# Create the Gradio interface\n",
|
310 |
+
"input_image = gr.Image()\n",
|
311 |
+
"iface = gr.Interface(\n",
|
312 |
+
" fn=predict_pokemons,\n",
|
313 |
+
" inputs=input_image, \n",
|
314 |
+
" outputs=gr.Label(),\n",
|
315 |
+
" examples=[\"Abra1.png\", \"Abra2.png\", \"Abra3.jpg\", \"Beedrill1.jpg\", \"Beedrill2.jpg\", \"Beedrill3.png\", \"Pikachu1.png\", \"Pikachu2.jpg\", \"Pikachu3.png\"], \n",
|
316 |
+
" description=\"Pokemon Classifier\")\n",
|
317 |
+
"iface.launch()"
|
318 |
+
]
|
319 |
+
}
|
320 |
+
],
|
321 |
+
"metadata": {
|
322 |
+
"kernelspec": {
|
323 |
+
"display_name": "venv_new",
|
324 |
+
"language": "python",
|
325 |
+
"name": "python3"
|
326 |
+
},
|
327 |
+
"language_info": {
|
328 |
+
"codemirror_mode": {
|
329 |
+
"name": "ipython",
|
330 |
+
"version": 3
|
331 |
+
},
|
332 |
+
"file_extension": ".py",
|
333 |
+
"mimetype": "text/x-python",
|
334 |
+
"name": "python",
|
335 |
+
"nbconvert_exporter": "python",
|
336 |
+
"pygments_lexer": "ipython3",
|
337 |
+
"version": "3.9.6"
|
338 |
+
}
|
339 |
+
},
|
340 |
+
"nbformat": 4,
|
341 |
+
"nbformat_minor": 2
|
342 |
+
}
|
mabel-poke.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3ec0e03cace02f88213b94fe7277e4c36a4cc08a74693fd2e858e804662da8ae
|
3 |
+
size 83657217
|
mabs_task2.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|