We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am making an image classification app.
My tflite model has input shape = (1,244,244,3) After reading image from image picker, and load as TensorImage, my image shape is (244,244,3).
When I put the image to run in the interpreter
_model.interpreter.run(inputTensorImage.buffer, outputBuffer.buffer);
Following error occurs. StateError (Bad state: failed precondition)
How can I change my image dimension (244,244,3) into (1,244,244,3) in flutter-tflite?
The text was updated successfully, but these errors were encountered:
Just put the input inside [ ]. You can also see this in the given example here.
[ ]
Sorry, something went wrong.
For other people, who are searching for solution, here is a gist of code.
final imageMatrix = List.generate( imageInput.height, (y) => List.generate( imageInput.width, (x) { final pixel = imageInput.getPixel(x, y); return [pixel.r, pixel.g, pixel.b]; }, ), ); newMatrix = [imageMatrix];
No branches or pull requests
How to expand_dims in flutter tflite
I am making an image classification app.
My tflite model has input shape = (1,244,244,3)
After reading image from image picker, and load as TensorImage, my image shape is (244,244,3).
When I put the image to run in the interpreter
_model.interpreter.run(inputTensorImage.buffer, outputBuffer.buffer);
Following error occurs.
StateError (Bad state: failed precondition)
How can I change my image dimension (244,244,3) into (1,244,244,3) in flutter-tflite?
The text was updated successfully, but these errors were encountered: