Back to projects

Python Computer Vision Project

Mayonnaise Container Defect Detection

Real-Time Visual Inspection Using YOLO and OpenCV

A real-time visual inspection system for tracking mayonnaise containers, detecting visible defects, classifying inspection results, and generating reports from camera or video input.

Status Prototype / Dataset Collection Stage
Illustrative concept of a camera inspecting packages for visible defects
Illustrative concept visual used for presentation. A real project inspection screenshot can be added later.

Project Overview

This project explores an automated visual-inspection workflow for mayonnaise containers. It processes camera or video input, tracks individual containers through an inspection region, evaluates visible defect signals, records the inspection result, and prepares data for future custom-model training.

My Role

Designed and developed the Python inspection pipeline, camera and video processing, object-tracking workflow, inspection reporting, failed-item snapshot capture, fallback logic, and dataset-collection utilities.

Development Status

The project is currently a prototype and dataset-collection baseline. It is not presented as a final industrial quality-control product or a publicly deployed factory system.

Inspection Workflow

Camera or video frames enter the inspection pipeline, where containers can be detected and tracked with sequential identifiers. Each tracked item passes through a configured inspection region or gate, receives a PASS or FAIL result, and can produce a CSV record and a failed-item snapshot.

Verified scope

Main Features

  • Real-time camera or video inspection
  • Container detection and tracking
  • Sequential container identifiers such as C0001
  • Region-of-interest or inspection-gate workflow
  • PASS and FAIL classification
  • Defect confidence display
  • CSV inspection reporting
  • Automatic snapshots for failed inspections
  • Optional video recording
  • Dataset image collection
  • YOLO-ready dataset preparation
  • Label validation and dataset auditing
  • OpenCV fallback when YOLO weights or inference are unavailable

Configured targets

Target Defect Classes

  • Black spot
  • Dirt or stain
  • Hole
  • Deformation
  • Cap defect
  • Shape defect

Implementation

Technologies

  • Python
  • OpenCV
  • Ultralytics YOLO
  • pandas or openpyxl for reporting
  • CSV reporting
  • Camera and video input

Reporting and Dataset Tools

Inspection outcomes can be written to CSV reports, failed inspections can trigger automatic snapshots, and optional recording can preserve video output. Dataset utilities support image collection, YOLO-ready preparation, label validation, and dataset auditing.

Technical Limitation Note

The current version is a calibration, inspection, and dataset-collection baseline. Production-quality defect detection requires a trained custom YOLO model and validation using representative factory data.

Exploring a computer-vision workflow?

Let’s discuss a practical prototype and validation plan.

Contact Me