detections method

Future<List<Detection>> detections(
  1. ViamImage image, {
  2. Map<String, dynamic>? extra,
})

Get a list of Detections from the provided ViamImage.

// Example:
var latestImage = await myWebcam.image();
var detections = await myVisionService.detections(latestImage);

Implementation

Future<List<Detection>> detections(ViamImage image, {Map<String, dynamic>? extra}) async {
  final request = GetDetectionsRequest(
      name: name,
      image: image.raw,
      width: Int64(image.image?.width ?? 0),
      height: Int64(image.image?.height ?? 0),
      mimeType: image.mimeType.name,
      extra: extra?.toStruct());
  final response = await client.getDetections(request);
  return response.detections;
}