Overview
This project is a real-time package detection and analysis system designed for monitoring conveyor belts and package handling in warehouses. The system utilizes YOLO (You Only Look Once) for object detection and Google Gemini AI for advanced image analysis. It identifies packages, tracks them, extracts relevant information (e.g., front flap open, damage condition), and generates alerts if necessary.
Key Features
✅ Package Detection & Tracking: Uses a YOLO-based deep learning model to detect and track packages in a video stream.
✅ AI-Based Package Analysis: Integrates Google Gemini AI to analyze each package and determine:
- Box Front Flap Open (Yes/No)
- Damage Condition (Yes/No)
✅ Automated Data Logging: Saves extracted package details into a text file (package_data_YYYY-MM-DD.txt) for record-keeping.
✅ Real-Time Alerts:
- Triggers an audio alert (using
pygame) when an open or damaged package is detected. - Stops the alert once no issues are found.
✅ Multithreading for Efficiency: Runs package cropping and AI processing on separate threads to avoid slowing down video analysis.
✅ Mouse Interaction Support: Displays real-time mouse position on the video window for debugging.
How It Works
- The system processes a video file frame by frame.
- YOLO detects packages and assigns a unique tracking ID to each detected object.
- When a package crosses a predefined detection line, it is cropped and saved as an image.
- The cropped image is sent to Google Gemini AI, which analyzes the package condition.
- The extracted details are logged into a file, and if necessary, an alert sound is triggered.
- The video is displayed in real time, with bounding boxes and tracking IDs overlaid.
Technologies Used
- Computer Vision: OpenCV, YOLO (Ultralytics)
- AI & Deep Learning: Google Gemini AI
- Threading: For efficient real-time processing
- Audio Alerts: Pygame for sound notifications
- Python Libraries: NumPy, CVZone, Base64 for image encoding
Use Cases
- Warehouse Automation: Detect damaged/open packages on conveyor belts.
- Logistics & Supply Chain: Ensure package integrity during transit.
- Retail & E-commerce: Monitor packaging quality before shipment.
Conclusion
This AI-powered package inspection system enhances logistics automation by detecting packages, analyzing their condition, and triggering alerts for damaged or open boxes. It offers an efficient, scalable, and AI-driven approach to real-time package tracking and quality assurance in warehouses and supply chain operations.

Reviews
There are no reviews yet.