getImagePredictionListProbabilitiesFromBytesList method

Future<List<double>> getImagePredictionListProbabilitiesFromBytesList(
  1. List<Uint8List> imageAsBytesList,
  2. int imageWidth,
  3. int imageHeight, {
  4. List<double> mean = torchVisionNormMeanRGB,
  5. List<double> std = torchVisionNormSTDRGB,
})

Returns a list of probabilities for an image as a bytes list. The image are passed as a list of Uint8List objects. The imageWidth and imageHeight parameters specify the dimensions of the image. The optional mean and std parameters can be used to normalize the image. Returns a Future that resolves to a list of double values representing the probabilities.

Implementation

Future<List<double>> getImagePredictionListProbabilitiesFromBytesList(
    List<Uint8List> imageAsBytesList, int imageWidth, int imageHeight,
    {List<double> mean = torchVisionNormMeanRGB,
    List<double> std = torchVisionNormSTDRGB}) async {
  // Get the predictions using the getImagePredictionListFromBytesList method
  final List<double> prediction = await getImagePredictionListFromBytesList(
      imageAsBytesList, imageWidth, imageHeight,
      mean: mean, std: std);

  // Return the probabilities derived from the predictions
  return getProbabilities(prediction);
}