- Created PGHLog utility with "PGH - " prefix for easy log filtering
- Enhanced MLResult with specific error types (MLErrorType enum)
- Updated MLInferenceEngine interface to use MLResult pattern
- Converted all Log.* calls to PGHLog.* in core components
- Added type-specific error recovery strategies with onErrorType()
- Improved error propagation and debugging capabilities
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add @UnsafeVariance annotation to fix 'out' type parameter usage in input position
- Ensures compilation succeeds with the new error handling infrastructure
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
High Priority Fixes:
- Fix thread pool management: Add shared preprocessingExecutor to prevent creating new thread pools per detection
- Add proper thread pool shutdown with grace period in cleanup() method
- Remove memory leak from repeated Executors.newFixedThreadPool() calls
Code Quality Infrastructure:
- Add MatUtils.kt with safe Mat resource management extension functions
- Add MLResult.kt with standardized error handling for ML operations
- Prepare foundation for systematic error handling improvements
Performance Impact:
- Eliminates thread pool creation overhead during inference
- Reduces memory pressure from abandoned thread pools
- Maintains all original ML detection functionality
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>