praveensunkara/Dog-Attack-Detection-Spy-YOLOv5
๐ถ Dog-Attack-Detection-Spy-YOLOv5
A Raspberry Pi-based dog attack detection system powered by YOLOv5.
This solution helps in preventing dog attacks by:
- Detecting approaching/aggressive dogs
- Triggering an alarm sound to scare them away
- Sending the incident location via SMS using a GPS module
- This project is supported by the our patent! ---
๐ System Deployment
- ๐ง Model: YOLOv5 (custom-trained)
- ๐ท Hardware: Raspberry Pi 4 with Camera Module
- ๐ก Sensors: GPS Module for location tracking
- ๐ Output: Alarm + SMS alert to registered number
- ๐งฐ Code: Written in Python, optimized for edge devices
๐ธ Sample Detection Outputs
๐ Dog Attack References
Due to frequent dog attacks, several people suffer injuries or die from rabies. The following images reflect real-world references.
<table> <tr> <td><img src="images/image1.jpg" width="250"/></td> <td><img src="images/image2.jpg" width="250"/></td> </tr> <tr> <td><img src="images/image3.jpg" width="250"/></td> <td><img src="images/image4.jpg" width="250"/></td> </tr> </table>
๐งช Prototype Setup & ๐ YOLOv5 Inference Output
These images show examples of YOLOv5 identifying potential dog attack scenarios and our physical prototype setup.
<table> <tr> <td><img src="images/image5.jpg" width="300"/></td> <td><img src="images/image6.png" width="300"/></td> <td><img src="images/image7.jpg" width="300"/></td> </tr> </table>
๐ฅ Demo Video
โถ๏ธ Click to watch demo video
โ ๏ธ GitHub does not support video autoplay. You can also view on YouTube for a better viewing experience.
๐ Features at a Glance
๐ ๏ธ Installation & Usage
Follow the steps below to set up and run the Dog Attack Detection Streamlit app:
1๏ธโฃ Clone the Repository
git clone https://github.com/praveensunkara19/Dog-Attack-Detection-Spy-YOLOv5.git
cd Dog-Attack-Detection-Spy-YOLOv5
2๏ธโฃ Create and Activate a Virtual Environment (Recommended)
Create virtual environment (Windows):
python -m venv myenv
Activate the virtual environment:
myenv\Scripts\activate
3๏ธโฃ Install Required Dependencies
pip install -r requirements.txt
โ
Ensure you have Python 3.8+ installed.
4๏ธโฃ Run the Streamlit App
streamlit run app.py
The app will open automatically in your browser. You can:
Upload images/videos for detection
Try the built-in test image/video
View side-by-side results of predictions๐ฆ Folder Structure
Dog-Attack-Detection-Spy-YOLOv5/ โ โโโ images/ # Sample image outputs + demo video โ โโโ image1.jpg โ โโโ image2.jpg โ โโโ image3.jpg โ โโโ image4.jpg โ โโโ image5.jpg โ โโโ image6.png โ โโโ yolovideo.mp4 โ โโโ test/ # Test input files โ โโโ testimg.jpg โ โโโ testvideo.mp4 โ โโโ yolov5_best.pt # Trained YOLOv5 model โโโ app.py # Streamlit app โโโ requirements.txt # Dependencies โโโ README.md # Project documentation
๐ฌ Contact
For issues, suggestions, or collaborations: ๐ง Email Me: praveensunkara19@gmail.com ๐ GitHub: praveensunkara19
