wasmiester/CapsuleGuard_AI
Computer vision system that detects capsules in a camera frame and classifies them as damaged, scuffed, or intact using OpenCV for detection and PyTorch for deep learning inference.
What's novel
Computer vision system that detects capsules in a camera frame and classifies them as damaged, scuffed, or intact using OpenCV for detection and PyTorch for deep learning inference.
Code Analysis
13 files read · 4 roundsA real-time capsule anomaly detection system that uses OpenCV contour detection to crop individual capsules from webcam frames, then feeds them through Anomalib's Patchcore model (a memory-bank anomaly detector) to score whether each capsule is anomalous, with a Kafka-based frame streaming pipeline
Strengths
The ROI cropping before inference is a sensible design choice that reduces noise and computation, and the data augmentation pipeline (rotation × scale × brightness) is well-structured for anomaly detection training. The project demonstrates a working end-to-end pipeline from camera capture through inference to visualization.
Weaknesses
The README mischaracterizes the system as a 3-class classifier (intact/scuffed/damaged) when it's actually a single-score anomaly detector, and there are multiple bugs (test_brain.py uses an empty path, prepare_crop hardcodes .cuda() with no fallback, config specifies wide_resnet50_2 but code uses resnet18). The Kafka pipeline is disconnected from the main detection loop, and there are no real automated tests.
Score Breakdown
Signal breakdown
Innovation
Craft
Traction
Scope
Evidence
Commits
18
Contributors
1
Files
17
Active weeks
2
Repository
Language
Python
Stars
1
Forks
0
License
—