Explainable Vision Rules
Uses a deterministic OpenCV pipeline that segments the part, finds contours, measures size and position, detects shape and material-color cues, and applies readable QA rules.
Manufacturing QA / Computer Vision / FastAPI
Martinrea FactorySight QA is a full-stack computer vision inspection system that simulates a factory quality-control station. It captures webcam frames, processes them through a Python and OpenCV pipeline, classifies each workpiece as PASS, FAIL, or REVIEW, stores inspection results in SQLite, and displays live KPIs in a React dashboard.
Uses a deterministic OpenCV pipeline that segments the part, finds contours, measures size and position, detects shape and material-color cues, and applies readable QA rules.
Models a controlled inspection station with webcam capture, pass/fail/review classification, defect labeling, inspection persistence, and live production metrics.
FastAPI and SQLite back the inspection loop while a React, TypeScript, and TailwindCSS dashboard exposes recent results, status distribution, and QA KPIs.
Project Notes
I built FactorySight QA to show how edge computer vision can support automotive manufacturing quality control without needing a black-box model for every fixture. In a constrained station, rule-based inspection can be fast, explainable, and practical.
Each frame is processed through a Python and OpenCV pipeline that isolates the workpiece, extracts contours, computes the bounding box and center point, checks object scale, flags partial parts, and uses shape plus material-color cues to classify the inspection result.
The system separates hard failures from review cases. Parts that are too small, too large, or incorrectly positioned can fail immediately, while ambiguous cases such as a part touching the frame border are marked for review instead of hidden behind a single confidence score.
Inspection results are stored in SQLite so the dashboard can show live factory-style KPIs, recent inspections, defect trends, and the operational state of the station. That makes the project feel like a production support tool rather than just a webcam demo.
The architecture leaves room for YOLO or PyTorch defect models, PLC triggers, multi-camera inspection, fixture-specific calibration, and additional stations while keeping the first implementation transparent and easy to debug.
Videos
Code
if area_ratio < MIN_OBJECT_AREA_RATIO:
defects.append("undersized_or_too_far")
status = "FAIL"
elif area_ratio > MAX_OBJECT_AREA_RATIO:
defects.append("oversized_or_too_close")
status = "FAIL"
elif _object_touches_border(frame, detection):
defects.append("partial_part")
status = "REVIEW"
else:
status = "PASS"