initialize method
Loads the model. Must be called before validate.
Safe to call multiple times — subsequent calls are no-ops.
Implementation
Future<void> initialize() async {
if (_isReady) return;
try {
_interpreter = await _loader.loadFromAsset(modelAsset);
_isReady = true;
} catch (e) {
_isReady = false;
rethrow;
}
}