How to correctly use tflite plugin 1.1.2 Plugin Flutter?

Viewed 123

I am going to build a garbage classification flutter project with the help of the tflite. The tflite model can classify 6 classes of garbage.The information below is output and input details:

== Input details ==

[{'name': 'serving_default_input_1:0', 'index': 0, 'shape': array([ 1, 224, 224, 3], dtype=int32), 'shape_signature': array([ -1, 224, 224, 3], dtype=int32), 'dtype': <class 'numpy.float32'>, 'quantization': (0.0, 0), 'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}]

== Output details ==

[{'name': 'StatefulPartitionedCall:0', 'index': 499, 'shape': array([1, 6], dtype=int32), 'shape_signature': array([-1, 6], dtype=int32), 'dtype': <class 'numpy.float32'>, 'quantization': (0.0, 0), 'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}]

Therefore, my problem is how can I correctly set the values of this code snippet following my model information:

var recognitions = await Tflite.runModelOnImage(

path: filepath, // required

imageMean: 0.0, // defaults to 117.0

imageStd: 255.0, // defaults to 1.0

numResults: 2, // defaults to 5

threshold: 0.2, // defaults to 0.1

asynch: true // defaults to true

);

Thanks

0 Answers
Related