# πΎ Animal Detector πΎ
Welcome to the Animal Detector project! This repository contains code and resources for training a machine learning model to recognize 15 different animal classes and classify images accordingly.
## π¦ About the Project
This project uses a Convolutional Neural Network (CNN) to identify the following animals:
- Bear
- Bird
- Cat
- Cow
- Deer
- Dog
- Dolphin
- Elephant
- Giraffe
- Horse
- Kangaroo
- Lion
- Panda
- Tiger
- Zebra
The model is trained on images stored in the `animal_data` directory, and can classify new images provided by the user.
## π Project Structure
Animal-Detector/
βββ animal_data/
β βββ Bear/
β βββ Bird/
β βββ Cat/
β βββ ... (other animal folders)
βββ Animal-Detector.py
βββ Animal-Detector-model.py
βββ bear-1.jpg
βββ README.md
βββ requirements.txt
- `animal_data/`: Contains subdirectories for each animal class with training images.
- `Animal-Detector.py`: Script to classify a new image.
- `Animal-Detector-model.py`: Script to train and save the model.
- `bear-1.jpg`: Sample image for testing.
- `README.md`: Project documentation.
- `requirements.txt`: List of required Python packages.
## π Getting Started
### Prerequisites
Ensure you have Python installed along with the necessary packages:
```sh
pip install -r requirements.txt
To train the model, run:
python Animal-Detector-model.py
This will train the CNN on the images in animal_data/
and save the trained model as animal_classifier_model.h5
.
To classify a new image, use:
python Animal-Detector.py path_to_your_image.jpg
Replace path_to_your_image.jpg
with the path to the image you want to classify. The script will output the predicted animal class and confidence level.
Here's an example of how to use the classifier with the provided bear-1.jpg
image:
python Animal-Detector.py bear-1.jpg
This image is a Bear with 98.76% confidence.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the need to classify and detect animals using machine learning.
- Thanks to the TensorFlow and Keras communities for their excellent resources and support.
Feel free to fork this repository and make improvements. Pull requests are welcome!
π Author: Armanx200
This README includes emojis, a clear structure, and detailed instructions to make the project easy to understand and use.