This repository contains a working prototype for an application that counts items in a grocery shop or inventory warehouse using a camera. The system leverages deep learning (using a pre-trained YOLOv5 model) to detect objects, counts them, and associates each detection with product details from a simulated product database.
- Overview
- Features
- Project Structure
- Prerequisites
- Installation
- Running the Prototype
- Deployment
- Data Engineering & Deep Learning
- Contributing
- License
This project demonstrates an end-to-end pipeline for counting items using a camera. The application:
- Captures images via a webcam.
- Processes images with a YOLOv5 model (loaded via PyTorch Hub) to detect and count objects.
- Looks up associated product details (brand and product name) using a simulated product database.
- Displays the detection results with bounding boxes and labels.
The system is designed to function even if detailed product information is not available—by simply aggregating the count of similar items.
- Real-time Image Capture: Uses OpenCV to capture images from a webcam.
- Object Detection: Utilizes YOLOv5 to identify items in the captured image.
- Product Counting: Counts detected items and aggregates results.
- Product Lookup: Matches detected labels with a product details dictionary.
- Visualization: Annotates and displays images with bounding boxes and labels.
main.py
: Main script to capture an image, perform object detection, count items, and display annotated results.README.md
: This file.requirements.txt
: (Optional) File listing project dependencies.
- Python 3.7 or later
- A functional webcam connected to your system
The project relies on the following libraries:
- OpenCV (
opencv-python
) - PyTorch (
torch
andtorchvision
) - NumPy (
numpy
)