I'm using this template/package to draw in Flutter https://pub.dev/packages/scribble/example.
Now I want to convert the drawn image to a File. So that I can use it in my tflite model. To predict the image the runModelOnImage (tflite package) function requires a path to the image.
The used scribble package, provides the saveImage function to return the drawn image as byteData:
// saveImage
Future<void> _saveImage(BuildContext context) async {
final image = await notifier.renderImage();
showDialog(
context: context,
builder: (context) => AlertDialog(
title: const Text("Your Image"),
content: Image.memory(image.buffer.asUint8List()),
),
);
}
How can I transform the byteData image to a File so I can use it in my model?