CLIP Changes:
- Changed from 4-class to simple binary comparison (normal vs defect)
- Lowered default threshold from 0.5 to 0.25 (more sensitive)
- Now logs both normal and defect probabilities
- Returns defect probability directly instead of summing classes
- Added normal_score to detection metadata
Visualization Improvements:
- CLIP: Always shows anomaly score on image (even if no detection)
- CLIP: Shows defect vs normal scores in label
- CLIP: Green text when no anomaly detected
- OWL-ViT: Shows detection count
- OWL-ViT: Numbered detections (#1, #2, etc)
- Both: Show threshold used when no detection
- Thicker bounding boxes (3px instead of 2px)
This makes it much clearer what the models are seeing and why they did/didnt detect.
Test file added: test_zeroshot.py (creates synthetic defect images for testing)
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>