Spaces:
Sleeping
Sleeping
victor
commited on
Commit
·
7b64e42
1
Parent(s):
272fbdc
last push
Browse files
app.py
CHANGED
|
@@ -2,37 +2,6 @@ from fastai.vision.all import *
|
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
# Define the list of 1st generation Pokémon class names
|
| 5 |
-
"""class_names = [
|
| 6 |
-
"Bulbasaur", "Ivysaur", "Venusaur",
|
| 7 |
-
"Charmander", "Charmeleon", "Charizard",
|
| 8 |
-
"Squirtle", "Wartortle", "Blastoise",
|
| 9 |
-
"Caterpie", "Metapod", "Butterfree",
|
| 10 |
-
"Weedle", "Kakuna", "Beedrill",
|
| 11 |
-
"Pidgey", "Pidgeotto", "Pidgeot",
|
| 12 |
-
"Rattata", "Raticate", "Spearow",
|
| 13 |
-
"Fearow", "Ekans", "Arbok",
|
| 14 |
-
"Psyduck", "Golduck", "Machop",
|
| 15 |
-
"Machoke", "Machamp", "Bellsprout",
|
| 16 |
-
"Weepinbell", "Victreebel", "Tentacool",
|
| 17 |
-
"Tentacruel", "Geodude", "Graveler",
|
| 18 |
-
"Golem", "Ponyta", "Rapidash",
|
| 19 |
-
"Magnemite", "Magneton", "Krabby",
|
| 20 |
-
"Kingler", "Exeggcute", "Exeggutor",
|
| 21 |
-
"Cubone", "Marowak", "Hitmonlee",
|
| 22 |
-
"Hitmonchan", "Lickitung", "Koffing",
|
| 23 |
-
"Weezing", "Rhyhorn", "Rhydon",
|
| 24 |
-
"Chansey", "Tangela", "Kangaskhan",
|
| 25 |
-
"Horsea", "Seadra", "Goldeen",
|
| 26 |
-
"Seaking", "Staryu", "Starmie",
|
| 27 |
-
"Mr. Mime", "Scyther", "Jynx",
|
| 28 |
-
"Electabuzz", "Magmar", "Pinsir",
|
| 29 |
-
"Tauros", "Magikarp", "Gyarados",
|
| 30 |
-
"Lapras", "Ditto", "Eevee",
|
| 31 |
-
"Vaporeon", "Jolteon", "Flareon",
|
| 32 |
-
"Porygon", "Omanyte", "Omastar",
|
| 33 |
-
"Kabuto", "Kabutops", "Aerodactyl",
|
| 34 |
-
"Mew", "Mewtwo"
|
| 35 |
-
]"""
|
| 36 |
|
| 37 |
def get_x(item):
|
| 38 |
return item['image'] # Access images directly
|
|
@@ -53,14 +22,11 @@ def classify_pokemon(img):
|
|
| 53 |
|
| 54 |
# Gradio interface setup
|
| 55 |
title = "Pokémon first gen classifier"
|
| 56 |
-
description = "Based on the famous scene (Who's that Pokémon) of the
|
| 57 |
image = gr.Image(type='pil') # Image size should match your training data size (e.g., 128x128)
|
| 58 |
label = gr.Label()
|
| 59 |
examples = ['zapdos.jpg']
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
# Set up Gradio interface
|
| 65 |
intf = gr.Interface(
|
| 66 |
fn=classify_pokemon,
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
# Define the list of 1st generation Pokémon class names
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
def get_x(item):
|
| 7 |
return item['image'] # Access images directly
|
|
|
|
| 22 |
|
| 23 |
# Gradio interface setup
|
| 24 |
title = "Pokémon first gen classifier"
|
| 25 |
+
description = "Based on the famous scene (Who's that Pokémon) of the Pokémon TV show, this neural network accurately classifies a Pokémon image."
|
| 26 |
image = gr.Image(type='pil') # Image size should match your training data size (e.g., 128x128)
|
| 27 |
label = gr.Label()
|
| 28 |
examples = ['zapdos.jpg']
|
| 29 |
|
|
|
|
|
|
|
|
|
|
| 30 |
# Set up Gradio interface
|
| 31 |
intf = gr.Interface(
|
| 32 |
fn=classify_pokemon,
|