This project implements an object detection system using YOLOv5 and OpenCV. It detects objects in real-time from a webcam feed, displaying relevant information such as FPS and detected objects. The system also allows users to record video and capture frames on demand using a pre-trained YOLOv5 model from the Ultralytics repository.
- Real-time Object Detection: Detects and classifies objects in the camera stream.
- FPS Display: Shows real-time FPS to monitor performance.
- Recording: Toggle video recording with the press of a button. Saves the video in MP4 format.
- Frame Capture: Capture and save frames as images with a timestamped filename.
- Alert on Detection: Highlights the number of detected objects and alerts the user.
- Press 'q': Quit the program.
- Press 'r': Toggle video recording on/off.
- Press 'c': Capture the current frame as a JPG image.
- Clone or download the repository.
- Install the required dependencies:
pip install -r requirements.txt
- Run the script.
python object_detection.py
- YOLOv5 for object detection Ultralytics
- OpenCV for video handling OpenCV
- PyTorch for deep learning Pytorch
- NumPy for numerical computation Numpy
This project is licensed under the MIT License - see the LICENSE file for details.
For feedback or inquiries, feel free to reach out via [email protected].