This project implements a real-time object detection system using the YOLOv8 Nano model and OpenCV. The system is capable of identifying over 80 commonly encountered objects from a webcam feed, such as people, furniture, animals, electronic devices, and structural elements. It is designed to be lightweight, modular, and easily extensible for research, surveillance, or industrial applications.
- Perform real-time object detection through a computer's webcam
- Detect multiple object classes from the COCO dataset
- Provide a modular codebase with clear separation of detection and visualization logic
- Offer an adaptable foundation for future enhancements, including model fine-tuning and real-world deployment
object-detection-ai/
├── models/
│ └── yolov8n.pt # Pretrained YOLOv8 Nano model
├── utils/
│ └── draw_boxes.py # Utility for drawing bounding boxes and labels
├── realtime_detection.py # Main script for webcam-based detection
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- Python 3.7 or higher
- Operating System: Windows, macOS, or Linux (GUI required)
- A functioning webcam
- pip package manager
- Clone the Repository
git clone https://github.com/Ahmadjamil888/REALTIME-OBJ-DETECTION-SURVIELLENCE.git
cd object-detection-ai
- Install Dependencies
pip install -r requirements.txt
- Download the YOLOv8 Model
Download the pretrained YOLOv8 Nano model file from the official Ultralytics release:
Place the file in the models/
directory as follows:
object-detection-ai/models/yolov8n.pt
Execute the detection script from the root of the project directory:
python realtime_detection.py
This system uses the YOLOv8 model pretrained on the COCO dataset. It can be customized for other use cases by:
- Replacing the model with a fine-tuned YOLO variant
- Modifying the
draw_boxes.py
logic to support additional metadata - Integrating audio alerts, frame saving, or motion-based triggers
This project is intended for educational and research purposes only. Consult relevant licensing terms for the YOLO model and third-party libraries before deploying in commercial or defense applications.