switchModel method

Future<void> switchModel(
  1. String modelPath, [
  2. YOLOTask? task
])

Implementation

Future<void> switchModel(String modelPath, [YOLOTask? task]) async {
  if (_methodChannel == null || _viewId == null) return;
  final resolvedModel = await YOLOModelResolver.resolve(
    modelPath: modelPath,
    task: task,
  );
  await _invoke('setModel', {
    'modelPath': resolvedModel.modelPath,
    'task': resolvedModel.task.name,
  });
}