https://github.com/pushtogithub23/wildlife-yolo-detector
This project implements a wild animal detection system using YOLOv8, Roboflow, and Python, allowing real-time tracking in images and videos.
https://github.com/pushtogithub23/wildlife-yolo-detector
computer-vision object-detection roboflow yolov8
Last synced: 7 months ago
JSON representation
This project implements a wild animal detection system using YOLOv8, Roboflow, and Python, allowing real-time tracking in images and videos.
- Host: GitHub
- URL: https://github.com/pushtogithub23/wildlife-yolo-detector
- Owner: Pushtogithub23
- License: mit
- Created: 2024-10-24T15:30:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-27T11:38:54.000Z (over 1 year ago)
- Last Synced: 2025-01-14T12:53:39.964Z (over 1 year ago)
- Topics: computer-vision, object-detection, roboflow, yolov8
- Language: Jupyter Notebook
- Homepage: https://universe.roboflow.com/puspendu-ai-vision-workspace/wild-animals-detection-fspct
- Size: 75.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🦁 Wild Animals Detection using YOLOv8
A comprehensive implementation of a wild animals detection system using YOLOv8, Roboflow, and Python. This project enables real-time detection and tracking of wild animals in images and videos.





## 🚀 Features
- Real-time wild animal detection in images and videos
- Support for both local files and URL-based images
- Automatic tracking of animals in video streams
- Confidence-based filtering of detections
- Custom visualization with optimized annotations
- Easy-to-use interface for both image and video processing
## 📋 Prerequisites
Before running this project, make sure you have the following dependencies installed:
```bash
pip install roboflow ultralytics supervision opencv-python matplotlib numpy requests
```
## 🛠️ Installation
1. Clone the repository:
```bash
git clone https://github.com/Pushtogithub23/wildlife-yolo-detector.git
cd wildlife-yolo-detector
```
2. Install required packages:
```bash
pip install -r requirements.txt
```
3. Set up your Roboflow API key:
- Create an account on [Roboflow](https://roboflow.com)
- Replace `YOUR_API_KEY` in the notebook with your actual API key
## 💻 Usage
### Image Detection
```python
# For local images
display_prediction(
"DATA/IMAGES/test_images/zebra_1.jpg",
save_fig=True,
filename='zebras_detected_1.jpg'
)
# For images from URL
display_prediction(
"https://example.com/image.jpg",
save_fig=True,
filename='detected_image.jpg'
)
```
I have attached a few image detections below:



### Video Detection
```python
predict_in_videos(
"DATA/VIDEOS/test_videos/zebras.mp4",
save_video=True,
filename='zebras_detected.mp4'
)
```
I have attached a few video detections below in gif format:


## 📦 Project Structure
```
wild-animals-detection/
├── DATA/
│ ├── IMAGES/
│ │ ├── test_images/
│ │ └── detected_images/
│ └── VIDEOS/
│ ├── test_videos/
│ └── captured_videos/
|── yolo-wild-animals-detection.ipynb
├── requirements.txt
└── README.md
```
## 🔧 Model Training
The project uses YOLOv8 large model (`yolov8l.pt`) as the base model for transfer learning. To train the model on your own dataset:
1. Prepare your dataset using Roboflow
2. Update the data.yaml file with correct paths
3. Run the training script:
```python
model = YOLO('yolov8l.pt')
model.train(
data="WILD-ANIMALS-DETECTION-1/data.yaml",
epochs=100,
imgsz=640
)
```
## 📝 Key Parameters
- Detection confidence threshold: 0.5
- Video processing can be stopped by pressing 'p'
- Image size for training: 640x640
- Training epochs: 100
## 🤝 Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## 🙏 References
- [Ultralytics](https://github.com/ultralytics/ultralytics) for YOLOv8
- [Roboflow](https://roboflow.com) for dataset management
- [Supervision](https://github.com/roboflow/supervision) for annotation tools
You can find the project on Roboflow by clicking [here](https://universe.roboflow.com/puspendu-ai-vision-workspace/wild-animals-detection-fspct)
You can view the training results on wandb(Weights & Biases) by clicking [here](https://wandb.ai/ranapuspendu24-iit-madras-foundation/Ultralytics/runs/o2ze0pai/workspace?nw=nwuserranapuspendu24)