Automated Product Label Inspection & Counting System
Project Overview
This project implements an AI-powered system for real-time product label inspection using computer vision and natural language processing. The system utilizes YOLOv8 for object detection and tracking and Google Gemini AI for analyzing the condition of detected products. It processes video streams to detect and track objects, extract cropped images, and send them to the Gemini AI model for quality assessment.
Key Features
1. Real-Time Object Detection and Tracking
- Uses a YOLOv8 model (
best.pt) for detecting and tracking objects in a video. - Tracks each detected object using unique track IDs.
- Identifies objects based on a predefined class list (
names).
2. Automated Image Cropping and Processing
- Extracts and saves cropped images of detected objects.
- Prevents duplicate processing of already tracked objects using a processed track ID set.
3. AI-Based Product Label Inspection
- Converts cropped images to base64 format for AI processing.
- Sends images to the Google Gemini AI model for analysis.
- Evaluates:
- Presence of a label on the bottle.
- Damage condition of the label.
- Returns structured results in a table format.
4. Asynchronous Processing with Multi-threading
- Cropped images are analyzed in separate threads to enhance performance.
- Prevents video processing delays while waiting for AI responses.
5. Data Logging and Reporting
- Saves AI analysis responses to a daily report file (
gemini_response_{date}_report.txt). - Stores individual response files alongside cropped images for detailed tracking.
6. Graphical Display of Results
- Draws bounding boxes and labels on detected objects.
- Overlays track IDs and class names on the video feed.
- Displays a detection boundary line to trigger product analysis.
Use Cases
- Quality Control in Manufacturing: Ensuring product labels are correctly applied and undamaged.
- Retail & Inventory Management: Automating product validation in warehouses.
- Food & Beverage Industry: Detecting missing or defective labels on bottles.
Technical Stack
- Computer Vision: OpenCV, YOLOv8 (
ultralytics) - AI & NLP: Google Gemini AI (
langchain_google_genai) - Image Processing: NumPy, cv2, cvzone
- Multithreading: Python
threadingmodule - File Management:
base64,os,time
Conclusion
Automated Product Label Inspection & Counting System system provides an automated, efficient, and AI-driven product quality assessment solution for industries requiring high-precision label inspection. By integrating YOLOv8 for object detection and Google Gemini AI for analysis, the solution ensures real-time inspection, reducing manual efforts and enhancing accuracy. 🚀

Reviews
There are no reviews yet.