processImage method

Future<List<ImageLabel>> processImage(
  1. InputImage inputImage
)

Processes the given image for image labeling, it returns a List of ImageLabel.

Implementation

Future<List<ImageLabel>> processImage(InputImage inputImage) async {
  final result = await _channel.invokeMethod(
      'vision#startImageLabelDetector', <String, dynamic>{
    'options': options.toJson(),
    'id': id,
    'imageData': inputImage.toJson()
  });
  final imageLabels = <ImageLabel>[];

  for (final dynamic json in result) {
    imageLabels.add(ImageLabel.fromJson(json));
  }

  return imageLabels;
}