CoolFace
Apppublic

praveensunkara/Dog-Attack-Detection-Spy-YOLOv5

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

๐Ÿถ 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

ComponentFunctionality
YOLOv5Dog detection and classification
Raspberry PiReal-time inference and sensor integration
GPS ModuleFetching latitude and longitude
Alarm OutputPlaying sound on detection
SMS ServiceAlerting a registered mobile number

๐Ÿ› ๏ธ Installation & Usage

Follow the steps below to set up and run the Dog Attack Detection Streamlit app:

bash
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