convertImageBytesToFloatBuffer static method

Future<Uint8List> convertImageBytesToFloatBuffer(
  1. Uint8List bytes,
  2. int width,
  3. int height,
  4. List<double> mean,
  5. List<double> std,
)

Implementation

static Future<Uint8List> convertImageBytesToFloatBuffer(
  Uint8List bytes,
  int width,
  int height,
  List<double> mean,
  List<double> std,
) async {
  await ImageUtilsIsolate.init();

  return (await ImageUtilsIsolate.computer.compute(
          _convertImageBytesToFloatBuffer,
          param: [bytes, width, height, mean, std]) as TransferableTypedData)
      .materialize()
      .asUint8List();
}