نظام ذكي لاكتشاف الحيوانات الأليفة والتنبيهات الذكية
Pet Detection & Smart Alert System
A real-time pet monitoring system using YOLOv8 and OpenCV to detect and track cats 🐱 and dogs 🐶 crossing a
virtual boundary, with automated email alerts and event snapshots.
Project Overview
This system detects, tracks, and counts pets as they cross a designated line in a video stream. It sends
automated email alerts with snapshots for verification, ensuring pet safety and enabling smart monitoring for
homes or designated zones.
Key Features
Real-Time Pet Detection
- ✅ Detects cats 🐱 and dogs 🐶 in live video streams.
- 📏 Smart line crossing detection – counts pets only when crossing the defined horizontal line.
- 🔁 Direction-aware counting – differentiates between IN and OUT movements.
- 🧠 Unique ID tracking – prevents double-counting of pets.
- 🎨 On-screen overlay – bounding boxes, labels, counts, and detection line.
- 📩 Automated email alerts with event snapshots.
- 💾 Video output – saves annotated footage for review.
Technology Stack
- 🐍 Programming Language: Python 3.x
- 🎥 Computer Vision: OpenCV
- 🧠 Object Detection: YOLOv8 (custom-trained on cats & dogs)
- 📊 Tracking: YOLOv8’s built-in .track() with persistent IDs
- 📧 Email Alerts: smtplib / Typer
Use Cases
- 🐾 Home Pet Monitoring – track when pets enter or exit specific areas.
- 🚪 Doorway Monitoring – count pets crossing access points.
- 📷 Automated Surveillance – monitor fenced yards or restricted zones.
- 🏠 Smart Home Integration – trigger alarms, lights, or IoT devices on movement.
Possible Enhancements
- 📈 Cloud Logging – store event history in CSV files or dashboards.
- 🔔 Custom Alerts – notifications via SMS, WhatsApp, or IoT platforms.
- 🧍 Multi-Class Support – extend to people, vehicles, or other objects.
- 🌐 Live Streaming – remote access to video feed and alerts.
- 🖥️ GUI Dashboard – build an interface for easier control and monitoring.
Conclusion
The Pet Detection & Smart Alert System provides robust real-time monitoring of pets using YOLOv8, tracking, and
automated email alerts.
It ensures both security and convenience for pet owners, and the framework can be adapted for people flow
monitoring, retail analytics, and security surveillance, making it a versatile AI-powered solution.