getImagePredictionListProbabilitiesFromBytesList method
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);
}