Project Overview
This project focuses on real-time bag detection, tracking, and classification using YOLO-based object detection and Google Gemini AI for detailed analysis. It is designed for monitoring conveyor belts, such as in airports, warehouses, or factories, where identifying bag types and colors is crucial for security and logistics.
Key Features
-
Real-time Bag Detection & Tracking
- Utilizes YOLO (You Only Look Once) to detect and track bags in a video stream.
- Assigns unique Track IDs to detected bags to avoid duplicate processing.
-
Bag Classification using Gemini AI
- Crops detected bag images and sends them to Google Gemini AI for classification.
- Extracts Bag Type (e.g., backpack, suitcase, handbag) and Bag Color (e.g., black, blue, red).
-
Automated Report Generation
- Stores classified bag details in a text file.
- Maintains a structured format with Timestamp, Track ID, Bag Type, and Bag Color.
-
Detection Line for Monitoring
- Implements a fixed detection line to trigger bag analysis only when they cross this point.
- Prevents redundant detections and optimizes processing speed.
-
Multi-threaded Image Processing
- Uses Python’s threading to asynchronously analyze cropped images, preventing slowdowns in real-time video processing.
-
User Interaction and Debugging
- Displays detected bags in a real-time OpenCV window with annotations.
- Includes a mouse callback function to track pixel coordinates for debugging.
- Allows users to quit the application using the “q” key.
Technology Stack
- Programming Language: Python
- Computer Vision Framework: OpenCV
- Deep Learning Model: YOLO12 (Ultralytics)
- AI Model for Analysis: Google Gemini AI
- Asynchronous Processing: Python Threading
- Data Storage: Text-based report generation
Use Cases
- Airport Security: Identify and classify passenger luggage in conveyor belt systems.
- Retail & Logistics: Monitor and categorize packages in warehouses.
- Industrial Automation: Automate baggage sorting in smart factories.
Customize Enhancements
- Integrate a database for structured storage of bag classifications.
- Implement real-time alerts for suspicious items based on AI analysis.
- Expand detection capabilities to identify prohibited items inside bags.
Conclusion
This AI-powered bag detection and classification system enhances efficiency and automation in monitoring conveyor belts. By combining YOLO for object detection and Gemini AI for classification, it ensures accurate identification of bags while maintaining high processing speed. With potential enhancements like database integration and real-time alerts, this system can be scaled for broader applications in security and logistics.

Reviews
There are no reviews yet.