Project Description:
This project uses YOLOv8 and real-time object tracking to detect, identify, and monitor sheep in a given video feed. Each sheep is uniquely assigned a track ID to enable accurate counting and movement monitoring. The system overlays bounding boxes, class labels, and tracking IDs, making it suitable for smart livestock monitoring in agricultural settings using drones or stationary cameras.
Core Objectives:
-
🧠 Automatically detect all sheep in a live or recorded video stream.
-
🔢 Assign and maintain unique IDs for each sheep across frames.
-
🎥 Visually annotate bounding boxes, centroids, and labels for real-time analysis.
-
🚜 Assist farmers or researchers in managing herd movement, count, and grouping behavior.
Key Features:
-
✅ YOLOv8 Detection: Leverages a custom-trained model (
best.pt) for high-accuracy sheep detection. -
🧠 ID Tracking: Uses Ultralytics’
track()function to persistently identify and label each sheep with a unique ID. -
🔵 Centroid Marking: Marks the center point of each sheep for spatial analysis or behavioral monitoring.
-
📏 Pixel Debugging Tool: Mouse callback to track pixel positions for line-based analytics or zoning.
-
🖼️ Customizable Visualization: Bounding boxes and readable ID overlays using
cvzone.putTextRect. -
🐑 Supports Multiple Sheep in Dense Groups: Designed to handle overlapping objects and re-identify correctly.
Technologies Used:
-
Python 3.x – scripting and automation
-
YOLOv8 (Ultralytics) – custom model trained for sheep detection
-
OpenCV – video input/output handling, image drawing, GUI
-
cvzone – annotation enhancements
-
NumPy – basic array manipulation
-
Ultralytics Tracker – for persistent ID tracking
Use Cases:
-
🐑 Livestock Management: Automated sheep counting and monitoring in pastures or sheds.
-
🚁 Drone Surveillance: Monitor herd movement via aerial views in open lands.
-
📈 Research: Study grazing patterns, animal spacing, and group dynamics.
-
🧾 Audit & Compliance: Use visual logs for welfare inspections or livestock audits.
-
🧑🌾 Farm Automation: Integrate into smart farms with autonomous data collection.
Possible Enhancements:
-
📊 Add counting logic (IN/OUT of gates or zones).
-
🐾 Implement movement tracking paths to analyze direction, speed, or grouping.
-
💾 Save video output with annotated IDs for offline review.
-
🌐 Stream data to cloud dashboards for remote livestock monitoring.
-
🤖 Integrate with thermal cameras for health and heat detection.
-
🛰️ Use GPS-based geo-fencing for open field animal tracking.
Conclusion:
This project demonstrates a robust and scalable real-time animal tracking system using deep learning. It serves as a foundation for agricultural automation, allowing farmers and researchers to monitor herd dynamics with minimal human intervention. With enhancements like counting, cloud integration, or geofencing, it can become a full-scale livestock monitoring platform.


Reviews
There are no reviews yet.