Sure, here's a sample README file for your code:
This project demonstrates a method for setting up an alert system for intruder detection using object detection and computer vision algorithms. The system can be modified to send alert directly to slack channel and whatapp using their respective API's.
Before running the code, ensure you have the following dependencies installed:
- Python 3.x
- OpenCV (
cv2
) - Ultralytics YOLO library
exception.py
,config.py
, andutils.py
files provided with the code
-
Clone the repository:
git clone https://github.com/your_username/intruder-detection.git cd intruder-detection
-
Install the required dependencies:
pip install -r requirements.txt
-
Download the YOLO pre-trained weights file and place it in the appropriate directory (specified in
config.py
).
-
Run the
intruder_detection.py
script:python intruder_detection.py
-
The script will capture video from the specified source (
sample_video
) and apply object detection to identify intruders in the frame. -
A Region of Interest (ROI) is defined on the first frame, allowing you to specify areas where intruders should be detected.
-
Detected intruders are highlighted in the video feed, and an alert is triggered if an intruder enters the defined ROI.
-
Press 'q' to exit the program.
- Accuracy can be improved by adjusting parameters such as confidence threshold (
conf
) and class labels in theconfig.py
file. - Modify the
sample_video
variable to use a different video source. - Also further code improve will also reduce the class miss detection chances.
- Modified the code to get get real time alert via raspberry pi based system for my home.
Contributions are welcome! Please feel free to open an issue or submit a pull request with any improvements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to adjust or expand upon this README to better suit your project's specific needs!