- Uncommented PVB Film example image references
- Images were manually uploaded to examples/ folder
- PVB Film model now fully integrated with clickable examples
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The app was crashing because example images don't exist yet.
PVB Film model is still available in the dropdown, just without
pre-loaded example images for now.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Added PVB-Film-Defect-Detection model to MODELS dictionary
- Added three example images for PVB Film model
- Model follows same YOLO pattern as existing models
Add SOTA zero-shot models: WinCLIP, AnomalyCLIP, SAA+ - 91.8% and 91.5% AUROC on MVTec AD - Compositional prompts and SAM-based segmentation
NEW MODEL: Florence-2 by Microsoft (FREE on HuggingFace)
Why Florence-2:
- Multimodal vision-language model (similar to Claude vision)
- Can detect and label objects automatically without text prompts
- No training data required - works on any image
- Better context understanding than CLIP/OWL-ViT
- Free and open-source on HuggingFace
Implementation:
- Model: microsoft/Florence-2-large
- Task: Object Detection (<OD>)
- Returns: Labeled bounding boxes automatically
- Confidence: 0.9 (high confidence detections)
- Color: Purple boxes for visualization
Features:
- Detects objects without predefined classes
- Automatically labels what it finds
- Good for finding anomalies and defects
- Works offline after first download
- Cached for fast inference
Visual:
- Purple bounding boxes (#128, 0, 128)
- Shows detection count
- Numbered labels (#1, #2, etc)
- Class names from model
This should be much better at detecting anomalies than CLIP/OWL-ViT!
🤖 Generated with Claude Code
Co-Authored-…
Improve zero-shot detection: simplified CLIP logic and better visualization
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>
Fix zero-shot models to actually detect anomalies using local inference
PROBLEM: Zero-shot models were calling external Gradio Spaces that were unreliable/offline, causing no detections.
SOLUTION: Replaced external API calls with local HuggingFace transformers inference.
New Implementations:
1. CLIP Anomaly Detection (replaces AdaCLIP):
- Uses openai/clip-vit-base-patch32 model locally
- Compares images against normal vs defect text descriptions
- Returns anomaly probability score
- Fast and reliable (no external dependencies)
- Red bounding boxes for detected anomalies
2. OWL-ViT Object Detection (fixed):
- Uses google/owlv2-base-patch16-ensemble locally
- Text-guided zero-shot object detection
- Default queries: defect, anomaly, crack, scratch, damage
- Returns actual bounding boxes from model
- Blue bounding boxes for detected objects
Technical Changes:
- Added dependencies: transformers, torch, torchvision, pillow
- Model caching on first load (function attributes)
- Proper error logging with tracebacks
- Lower defaul…
Added second zero-shot model alongside AdaCLIP. OWL-ViT is Google zero-shot detector that works via text queries. Uses adirik/OWL-ViT Space. Default queries: defect, anomaly, crack, scratch, damage. Blue boxes for OWL-ViT, red for AdaCLIP.
New function: run_owlvit_inference()
Updated: gradio_inference() and api_inference()
Models dictionary now has zero-shot-adaclip and zero-shot-owlvit
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add Zero Shot (Anomaly) model to app.py and remove unused api.py
- Add AdaCLIP zero-shot anomaly detection model to app.py
- Integrate gradio_client for calling external AdaCLIP Space
- Extract bounding boxes from heatmap for YOLO-compatible output
- Update UI and API to handle both YOLO and AdaCLIP models
- Remove unused api.py file
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add zero-shot anomaly detection model to model selection
- Integrate AdaCLIP from HuggingFace Space for anomaly detection
- Extract bounding boxes from heatmap for YOLO-compatible output
- Update Gradio interface to handle both YOLO and AdaCLIP models
- Add gradio_client to requirements
- Remove unused files (Dockerfile, README_API.md, requirements-api.txt)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add /api/health endpoint for service monitoring and health checks
- Implement rate limiting (100 requests per minute)
- Separate rate limits for UI and API endpoints
- Return error watermark on image when UI limit exceeded
- Return JSON error when API limit exceeded
- Add rate limiting documentation to Gradio UI
- Protect HuggingFace Space from abuse
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add /api/detect endpoint for JSON detections (MonitaQC compatible)
- Updated app.py with combined FastAPI and Gradio interface
- FastAPI endpoints at /v1/object-detection/detect (MonitaQC compatible)
- Gradio UI at /gradio for testing and demonstration
- Support for 8 defect detection models (ONNX-based)
- CPU-only inference (no GPU required)
- Health check and model listing endpoints
- Added comprehensive API documentation (README_API.md)
- Docker support for containerized deployment
- Compatible with MonitaQC vision engine API format
This allows multiple MonitaQC vision engines to use cloud-based
defect detection while maintaining a visual testing interface.