model_manager library
Model Manager API for fine-grained control over OCR model lifecycle.
The Model Management API provides:
- Download models separately from loading them
- Pre-download during onboarding for offline-first UX
- Query downloaded/loaded models with detailed metadata
- Check for updates before downloading
- Explicit memory management via load/unload
- Dynamic OCR prediction with explicit OCRModule selection
Classes
- DownloadProgress
- Reports download progress during model download.
- ModelInfo
- Information about a downloaded or loaded model.
- ModelLifecycleCallbacks
- A convenience implementation of ModelLifecycleListener that accepts callback functions for each event.
- ModelLifecycleListener
- Interface for observing model lifecycle events.
- ModelManager
- Main entry point for model management operations.
- ModelManagerConfig
- Configuration for ModelManager
- ModelManagerConfigBuilder
- Builder for configuring ModelManager
- ModelUpdateInfo
- Result of checking for model updates.
- OCRModule
- Represents an OCR module with its model class and size.
Enums
- ExecutionProvider
- ONNX Runtime execution providers for model inference.
- PlatformType
- Platform identifier for telemetry.
Exceptions / Errors
- ModelDownloadException
- Failed to download model.
- ModelException
- Base exception class for ModelManager operations.
- ModelLoadException
- Failed to load model into memory.
- ModelNetworkException
- Network or API failure during model download.
- ModelNoNetworkException
- No network connection available.
- ModelNotFoundException
- Model not found (not downloaded or doesn't exist).
- ModelRootedDeviceException
- Device is rooted - security violation.
- ModelSdkNotInitializedException
- VisionSDK is not initialized.
- ModelStorageException
- Insufficient storage for model download.