A Python-based object detection application for images and videos using the OpenCV Deep Neural Networks (DNN) module with GoogLeNet and YOLOv3 for real-time, high-accuracy detection.
This project leverages deep learning inference to classify and detect objects with bounding boxes and probability scores, using pre-trained models on the COCO dataset.
- 🖼 Image Object Detection – Detects multiple objects in an image and displays their bounding boxes with confidence scores.
- 🎥 Video Object Detection – Detects objects frame-by-frame with probability scores.
- 🧮 Color Channel Analysis – Displays different color channels from the image.
- ⚡ YOLOv3 Neural Network – Divides images into regions and predicts bounding boxes and class probabilities for each region.
- 📦 Pre-Trained Models – Uses GoogLeNet & YOLOv3 models trained on the COCO dataset.
| Component | Technology |
|---|---|
| Language | Python |
| Core Library | OpenCV |
| Deep Learning | OpenCV DNN module |
| Models Used | GoogLeNet, YOLOv3 |
| Dataset | COCO dataset |
- Deep learning for OpenCV
- Viewing images and videos in OpenCV
- Working with blobs in the DNN module
- Image classification & video classification
- YOLOv3-based object detection
/opencv-object-detector
│
├── /models # Pre-trained YOLOv3 & GoogLeNet models
├── /images # Sample images for detection
├── /videos # Sample videos for detection
├── detector.py # Main Python script for object detection
├── requirements.txt # Python dependencies
└── README.md
1️⃣ Clone the Repository
git clone https://github.com/Iamdk25/opencv-object-detector.git
cd opencv-object-detector2️⃣ Install Dependencies
pip install -r requirements.txt3️⃣ Download Pre-Trained Models • YOLOv3 Weights • YOLOv3 Config • GoogLeNet pre-trained model from the OpenCV model zoo
Place these files inside the /models directory.
4️⃣ Run Object Detection on an Image
python detector.py --image images/sample.jpg5️⃣ Run Object Detection on a Video
python detector.py --video videos/sample.mp4• ✅ Detect objects in images & display color channels
• ✅ Detect objects in videos with probability scores
• ✅ YOLOv3-based custom object detection
• ✅ Bounding box & confidence prediction per region
• ✅ Inference-based classification for images & videos
⸻
This project is licensed under the MIT License – see the LICENSE file for details.
⸻
Divyarajsinh Karmariya
💼 Computer Science Student @ University of South Florida
🔗 Portfolio • 🧠 GitHub • 💼 LinkedIn