getImagePredictionList method

Future<List?> getImagePredictionList(
  1. File image,
  2. int width,
  3. int height, {
  4. List<double> mean = TORCHVISION_NORM_MEAN_RGB,
  5. List<double> std = TORCHVISION_NORM_STD_RGB,
})

predicts image but returns the raw net output

Implementation

Future<List?> getImagePredictionList(File image, int width, int height,
    {List<double> mean = TORCHVISION_NORM_MEAN_RGB,
    List<double> std = TORCHVISION_NORM_STD_RGB}) async {
  // Assert mean std
  assert(mean.length == 3, "Mean should have size of 3");
  assert(std.length == 3, "STD should have size of 3");
  final List? prediction = await _channel.invokeListMethod("predictImage", {
    "index": _index,
    "image": image.readAsBytesSync(),
    "width": width,
    "height": height,
    "mean": mean,
    "std": std
  });
  return prediction;
}