getImagePredictionListProbabilities method

Future<List<double>> getImagePredictionListProbabilities(
  1. Uint8List imageAsBytes, {
  2. List<double> mean = torchVisionNormMeanRGB,
  3. List<double> std = torchVisionNormSTDRGB,
  4. PreProcessingMethod preProcessingMethod = PreProcessingMethod.imageLib,
})

Returns the predicted image probabilities using the given imageAsBytes.

The mean and std parameters are optional and default to the values of torchVisionNormMeanRGB and torchVisionNormSTDRGB. The preProcessingMethod parameter is optional and defaults to PreProcessingMethod.imageLib. Returns a Future that completes with a List<double> representing the predicted probabilities.

Implementation

Future<List<double>> getImagePredictionListProbabilities(
    Uint8List imageAsBytes,
    {List<double> mean = torchVisionNormMeanRGB,
    List<double> std = torchVisionNormSTDRGB,
    PreProcessingMethod preProcessingMethod =
        PreProcessingMethod.imageLib}) async {
  List<double> prediction = await getImagePredictionList(imageAsBytes,
      mean: mean, std: std, preProcessingMethod: preProcessingMethod);

  return getProbabilities(prediction);
}