loadModel method
Loads the YOLO model for inference.
This method must be called before predict to initialize the model.
Returns true
if the model was loaded successfully, false
otherwise.
Example:
bool success = await yolo.loadModel();
if (success) {
print('Model loaded successfully');
} else {
print('Failed to load model');
}
throws ModelLoadingException if the model file cannot be found
Implementation
Future<bool> loadModel() async {
if (!_isInitialized) {
_isInitialized = true;
}
return await _modelManager.loadModel();
}