0

I am trying to create a TensorImage for apply to my ML Model and get predictions. I'm using tflite_flutter package for that. But when I trying to access TensorImage, it doesn't recognize.

This is where Im trying to access Tensor Image:

I have imported the package as:

import 'package:tflite_flutter/tflite_flutter.dart';

final input = Uint8List.fromList(img.encodePng(resized));

// Here am getting the error as Undefined name 'TensorImage'.
final inputImage = TensorImage.fromUint8List(input);
final outputBuffer = Float32List(
    interpreter.getOutputTensor(0).shape.reduce((a, b) => a * b));

interpreter.run(inputImage.buffer, outputBuffer.buffer)
Benjamin Buch
  • 4,752
  • 7
  • 28
  • 51

0 Answers0