imageModelInference static method

Future<List<double>> imageModelInference(
  1. int modelIndex,
  2. Uint8List imageAsBytes,
  3. int imageHeight,
  4. int imageWidth,
  5. List<double> mean,
  6. List<double> std,
  7. bool objectDetectionYolov5,
  8. int outputLength,
)

Implementation

static Future<List<double>> imageModelInference(
    int modelIndex,
    Uint8List imageAsBytes,
    int imageHeight,
    int imageWidth,
    List<double> mean,
    List<double> std,
    bool objectDetectionYolov5,
    int outputLength) async {
  PytorchFfi.init();

  return (await imageModelInferenceManager.compute([
    modelIndex,
    imageAsBytes,
    imageHeight,
    imageWidth,
    mean,
    std,
    objectDetectionYolov5,
    outputLength
  ]) as TransferableTypedData)
      .materialize()
      .asFloat32List()
      .toList();
  // return _imageModelInference(
  //   [
  //   modelIndex,
  //   imageAsBytes,
  //   imageHeight,
  //   imageWidth,
  //   mean,
  //   std,
  //   objectDetectionYolov5
  // ]
  // );
}