This project uses YOLOv8 for real-time animal detection. It supports multiple animal classes, including chickens, cows, goats, pigs, and sheep. The application allows users to choose the type of animal they want to detect.
Before running the application, make sure you have the following dependencies installed:
- Python 3.x
- OpenCV
- Ultralytics YOLO library
You can install the required Python packages using the provided requirements.txt
file:
-
Clone the repository:
git clone https://github.com/David-Ademola/Animal-Detection.git cd Animal-Detection
-
Install dependencies:
⠀ pip install -r requirements.txt ⠀
-
Run the application:
- To run from a live webcam:
⠀ python main.py --video_resolution (resolution of your webcam) ⠀
- To run on a video:
⠀ python main.py --video_path (path to your video) ⠀
Upon running main.py
, you will be prompted to enter the type of animal you want to detect. Choose from the supported animals, and the application will start real-time detection using YOLOv8.
Press 'Esc' to exit the application.
- Chicken
- Cow
- Goat
- Pig
- Sheep
You can customize the application by modifying the count_and_track.py
file. Adjust the YOLOv8 weights, default zone polygon, and other parameters as needed.
If you'd like to contribute to this project, please follow the standard GitHub flow:
- Fork the repository
- Create a new branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/your-feature-name
- Submit a pull request
- YOLOv8: Link to YOLOv8 repository
- Supervision: Link to Supervision library
This project is licensed under the MIT License - see the LICENSE file for details.
- Akinwande David Ademola
Feel free to contribute or report issues!