This Flask web application allows users to upload an image of a Pokémon and predicts its name using a pre-trained neural network model (CNN). Additionally, it fetches detailed information about the predicted Pokémon, such as its forms, base stats, and evolution chain, by integrating with PokeAPI.
For those interested in exploring the model and its training process, a Jupyter Notebook file is included in the repository. You can use it to see how the image classification model was developed and tested.
- Upload an image of a Pokémon and receive a prediction of its species.
- Fetches detailed Pokémon information from PokeAPI, including types, forms, base stats, and evolution chains.
- Displays predicted Pokémon along with a representative image, forms, and evolution data.
- Handles special Pokémon forms (e.g., "Deoxys" or "Lycanroc") and caches API responses for improved performance.
-
Clone the repository:
git clone https://github.com/nyain/Pokedex.git
-
Install required dependencies:
pip install -r requirements.txt
-
Ensure the pre-trained model file
pokemon.keras
is in the root directory. -
Create a
static/
directory if it doesn't exist:mkdir static
-
Make sure you already have the dataset. You can scrape the dataset from this repository.
-
Start the Flask app:
python app.py
-
Open a browser and navigate to
http://127.0.0.1:5000/
. -
Upload a Pokémon image (PNG, JPG, JPEG) and view the prediction along with the Pokémon’s base stats, types, forms, and evolution chain.
- The app uses a pre-trained Keras model (
pokemon.keras
) with LeakyReLU activation. - The model is compiled using the Adam optimizer and categorical cross-entropy loss.
- The app utilizes PokeAPI to fetch real-time data about Pokémon species, forms, types, and evolution chains.
- Special Pokémon forms and alternate names (like "Mr. Mime" or "Giratina-Altered") are handled via custom logic.
- The app resizes and preprocesses the uploaded image to
150x150
before making predictions. - Cached API responses improve performance by reducing redundant requests.