infer method
Perform inference on an image For OCR: returns text recognition results For detection: returns detected objects For classification: returns class predictions
Implementation
Future<List<CVResult>> infer(String imagePath) async {
try {
final result = await _channel.invokeMethod('cvInfer', {
'wrapperId': _wrapperId,
'imagePath': imagePath,
});
return (result as List<dynamic>)
.map((e) => CVResult.fromMap(e as Map<String, dynamic>))
.toList();
} on PlatformException catch (e) {
throw Exception('Failed to perform CV inference: ${e.message}');
}
}