Like many pet owners, I've faced a common problem:
every time I leave the house, my dogs jump on the sofa and leave behind a mess of fur 🐾🛋️.
I've tried countless methods to prevent this but to no avail.
Motivated to find a solution, I decided to leverage the power of technology to create a tool to manage this issue. This led to the development of a system that combines computer vision, machine learning, object detection, and real-time notifications to my personal Telegram account. The application alerts 🚨 whenever it detects one of the dogs on the sofa, and it even sends an immediate update to my phone, complete with an image of the mischievous dog, enabling me to take immediate action, no matter where I am. This use of technology not only ensures my furniture's cleanliness but also allows me to remotely monitor my pets' behavior.
The system utilizes the YOLOv8 pre-trained model from Ultralytics.
I made several modifications, computations, and conditions to tailor the model for this specific application.
- Real-time detection of a specific event: dog climbing on a couch.
- Utilizes the powerful YOLOv8 model for object detection.
- Triggers real-time alerts when the event is detected.
- Sends real-time alerts with photos to a specified Telegram chat.
- Clone this repository to your local machine.
- Install the required packages using 'pip install -r requirements.txt'
- Position your computer in front of the couch. It's preferable if the computer's camera is parallel to the couch.
- Set up a Telegram bot Update the telegram_key and chat_id variables in the code with your bot's API key and your chat ID.
- Run the script 'python detector.py'
- The tool will then use your computer's camera to monitor the couch.
- The tool has been programmed to specifically detect dogs, cats, sofas, and beds while ignoring other objects.
- Message @BotFather on Telegram using the Telegram app.
- Type /newbot to create a new bot. Follow the instructions and set a name and username for your bot.
- After successfully creating the bot, BotFather will give you a token. This is your 'telegram_key' (keep it secret).
- Message @userinfobot on Telegram using the Telegram app.
- Press 'start'.
- The bot will reply to you with some personal information. The 'Id' is your 'chat_id' (keep it secret).
I hope that this tool will solve my problem. But even if it doesn't fully work as expected, I've thoroughly enjoyed the learning journey and the deep dive into the world of computer vision and object detection.
This is my first project using the YOLO model, so I welcome any feedback regarding the implementation, the code quality, and any potential optimizations that could ensure efficient runtimes even on relatively weak hardware. Your time and insights are greatly appreciated.
Thank you! 🙏
Stay tuned for future updates, enhancements, and the results of this project. I'll be posting regular updates as we progress.
Thanks for stopping by! 👋
I'd like to express my gratitude to the creators of the YOLOv8 model, as their work served as the foundation for this project.