getImagePredictionFromBytesList method

Future<List<ResultObjectDetection>> getImagePredictionFromBytesList(
  1. List<Uint8List> imageAsBytesList,
  2. int imageWidth,
  3. int imageHeight, {
  4. double minimumScore = 0.5,
  5. double iOUThreshold = 0.5,
  6. int boxesLimit = 10,
})

Performs object detection on an image as bytesList and returns a list of ResultObjectDetection with its assigned labels.

Parameters:

  • imageAsBytes: The image as bytes in Uint8List format.
  • imageWidth: The width of the image.
  • imageHeight: The height of the image.
  • minimumScore: The minimum confidence score for a detected object to be included in the results. Default is 0.5.
  • iOUThreshold: The threshold for intersection over union (IOU) to filter out redundant bounding boxes. Default is 0.5.
  • boxesLimit: The maximum number of bounding boxes to return. Default is 10.
  • preProcessingMethod: The preprocessing method to apply to the image before object detection. Default is PreProcessingMethod.imageLib.

Returns: A list of ResultObjectDetection containing the detected objects and their bounding boxes.

Implementation

Future<List<ResultObjectDetection>> getImagePredictionFromBytesList(
    List<Uint8List> imageAsBytesList, int imageWidth, int imageHeight,
    {double minimumScore = 0.5,
    double iOUThreshold = 0.5,
    int boxesLimit = 10}) async {
  List<ResultObjectDetection> prediction =
      await getImagePredictionListFromBytesList(
          imageAsBytesList, imageWidth, imageHeight,
          minimumScore: minimumScore,
          iOUThreshold: iOUThreshold,
          boxesLimit: boxesLimit);
  addLabels(prediction);

  return prediction;
}