This project implements a smart checkout system using YOLO V8 object detection to track and calculate the prices of products crossing a designated checkout line in a video feed.
The system uses the YOLO V8 model for real-time object detection and tracking. It identifies products as they move through a video frame. The system then calculates the total cost of detected products based on predefined prices.
- Object detection and tracking using YOLO V8.
- Cost calculation for specific product classes as they cross a defined line on the screen.
- Visual annotation of detected objects on the video frames.
- Output video with annotated frames showing tracked objects and total cost.
ultralytics: YOLO V8 model for object detection and tracking.cv2(OpenCV): For video capture, frame manipulation, and annotation.supervision: Custom library/module for video processing and output.
main.py: Python script implementing the smart checkout system.utils.py: Utility functions includingget_product_costfor calculating product costs.model/yolov8n.pt: Pre-trained YOLO V8 model file.test_videos/: Directory containing input video files for testing.test_output/: Directory for storing output videos with annotated frames.
To run the smart checkout system:
- Ensure all dependencies are installed (
ultralytics,cv2,supervision). - Place the input video (
video4.mp4or other test videos) in thetest_videos/directory. - Run
main.pyto process the video and generate the output.
