This project is an open vision initiative built using YOLOv8, a state-of-the-art object detection model developed by Ultralytics. It presents a complete pipeline for detecting animals from CCTV footage β suitable for both real-time and static image analysis.
The system is designed to be modular, scalable, and easy to deploy, and is particularly useful for:
- π Farm and livestock monitoring
- π Wildlife conservation and animal tracking
- π§ Roadside animal presence alerts
- π· General CCTV-based animal surveillance
This repository includes:
- β Custom dataset loading and analysis
- β Augmentation and data quality checks
- β YOLOv8 model training and evaluation
- β Inference interface for single images
- β Example visualization of results
Source: Private Dataset
Classes:
['Bird', 'Cats', 'Cow', 'Deer', 'Dog', 'Elephant', 'Giraffe', 'Person', 'Pig', 'Sheep']Folder Structure:
βββ train
βββ images
βββ labels
βββ valid
βββ images
βββ labels
βββ test
βββ images
βββ labels
Label Format (YOLO):
<class_id> <x_center> <y_center> <width> <height> # All values normalized (0β1)
- Upload the
.ipynbnotebook to Kaggle or run locally with Jupyter.
pip install ultralytics albumentations opencv-python matplotlib seaborn- Dataset structure check
- Class distribution visualization
- Sample image bounding box rendering
- Augmentation and quality validation
- Loads pretrained
yolov8s.pt - Trains for 25 epochs,
imgsz=640,batch=16 - Saves outputs to
runs/detect/animal-detection-yolov8/
Generates plots automatically:
- π F1 Curve
- π― Precision-Recall Curve
- β Precision and Recall
- Run inference on a static image
- Output is visualized directly using
matplotlib - Extendable to webcam/video input
Sample YOLOv8 output with bounding boxes on animal classes:
π· Image: valid/images/sample.jpg
β Detected: Cow, Dog, Sheep with confidence > 0.5
β Rendered bounding boxes in real-time
YOLOv8 provides performance metrics during and after training, including:
mAP@0.5,mAP@0.5:0.95- Precision, Recall, and F1 score
- Loss curves for training and validation
All metrics are logged automatically and plots are available under:
runs/detect/animal-detection-yolov8/
This project uses Python 3.8+ and runs in environments like Kaggle, Colab, or Jupyter.
pip install ultralytics albumentations opencv-python matplotlib seabornThe trained YOLOv8 weights arenβt published here please email champion19007@gmail.com to request access.
Sai Yashwant Reddy Panthy
AI/ML Developer
π§ Email: champion19007@gmail.com
Feel free to reach out for collaboration or inquiries.
