1.7 KiB
1.7 KiB
Technologies Used
Core ML & Vision
- ChessPieceClassifier.mlmodel for piece recognition
- VNCoreMLModel for image classification
- Vision framework for board detection
Image Processing
- CoreImage for preprocessing
- CIColorControls and CIUnsharpMask filters
- CGImage for image manipulation
Development Environment
- Xcode for Swift development
- Create ML for model training
- SwiftUI for UI components
Technical Constraints
ML Model Capabilities
-
Classification Types:
- Pieces: pawn, rook, knight, bishop, queen, king
- Colors: black, white
- Empty squares: dark, light
- Label formats: color_piece, empty_color
-
Recognition Features:
- Multi-class classification
- Per-class confidence scores
- Position-aware validation
- Piece count tracking
Processing Requirements
-
Image Requirements:
- Square dimensions (1:1 ±10%)
- Non-zero dimensions
- Center-cropped squares
- Clear piece visibility
-
Recognition Rules:
- Empty squares: exact class match with >0.9 confidence
- Pieces: strict format with >0.98 confidence
- Separation ratio: >5.0 between predictions
- Position validation: essential rules only
-
Error Prevention:
- Early empty square detection
- Strict label validation
- Safe optional handling
- Clear error messages
Performance Considerations
-
Processing Flow:
- Early validation checks
- Fast empty square detection
- Efficient error handling
- Quick rejection paths
-
Resource Optimization:
- GPU acceleration for ML
- Minimal preprocessing
- Optimized validation
- Efficient logging
Development Setup
- Clone repository
- Open ChessPrism.xcodeproj
- Build and run on macOS
- Model at ChessPrism/ChessPieceClassifier.mlmodel