Skip to content

champion19007/Real-Time-Animal-Detection-Using-CCTV-Camera-OpenVision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

πŸ“‘ Real-Time Animal Detection Using CCTV Camera (YOLOv8)

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

πŸ” Overview

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

πŸ—‚οΈ Dataset Info

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)

πŸ› οΈ Step-by-Step Usage

1️⃣ Clone or Upload the Project

  • Upload the .ipynb notebook to Kaggle or run locally with Jupyter.

2️⃣ Install Required Packages

pip install ultralytics albumentations opencv-python matplotlib seaborn

3️⃣ Load and Explore Dataset

  • Dataset structure check
  • Class distribution visualization
  • Sample image bounding box rendering
  • Augmentation and quality validation

4️⃣ Train the YOLOv8 Model

  • Loads pretrained yolov8s.pt
  • Trains for 25 epochs, imgsz=640, batch=16
  • Saves outputs to runs/detect/animal-detection-yolov8/

5️⃣ Visualize Training Results

Generates plots automatically:

  • πŸ“ˆ F1 Curve
  • 🎯 Precision-Recall Curve
  • βœ… Precision and Recall

6️⃣ Inference Interface

  • Run inference on a static image
  • Output is visualized directly using matplotlib
  • Extendable to webcam/video input

πŸ“Έ Example Output

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
output

🧠 Model Performance

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/

πŸ“¦ Requirements

This project uses Python 3.8+ and runs in environments like Kaggle, Colab, or Jupyter.

Install Libraries:

pip install ultralytics albumentations opencv-python matplotlib seaborn

πŸ”— Model Weights

The trained YOLOv8 weights aren’t published here please email champion19007@gmail.com to request access.


πŸ§‘β€πŸ’» Author

Sai Yashwant Reddy Panthy
AI/ML Developer
πŸ“§ Email: champion19007@gmail.com

Feel free to reach out for collaboration or inquiries.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published