tflite_flutter_custom 1.2.4 copy "tflite_flutter_custom: ^1.2.4" to clipboard
tflite_flutter_custom: ^1.2.4 copied to clipboard

TensorFlow Lite Flutter plugin provides an easy, flexible, and fast Dart API to integrate TFLite models in flutter apps across mobile and desktop platforms.

example/example.dart

// ignore_for_file: avoid_print
import 'dart:io';

import 'package:tflite_flutter_custom/tflite_flutter.dart';

/// Example demonstrating basic TFLite model inference.
///
/// To run this example, you need a TFLite model file.
/// See the full examples in the example/ subdirectories for complete
/// Flutter applications.
void main() async {
  // Load a model from a file
  final modelFile = File('/path/to/model.tflite');
  final interpreter = Interpreter.fromFile(modelFile);

  // Get input and output tensor info
  print('Input tensors: ${interpreter.getInputTensors()}');
  print('Output tensors: ${interpreter.getOutputTensors()}');

  // Prepare input data (shape depends on your model)
  var input = [
    [1.0, 2.0, 3.0, 4.0]
  ];

  // Prepare output buffer (shape depends on your model)
  var output = List.filled(1, List.filled(2, 0.0));

  // Run inference
  interpreter.run(input, output);

  print('Output: $output');

  // Clean up
  interpreter.close();
}
3
likes
160
points
277
downloads

Publisher

verified publisherhugocornellier.com

Weekly Downloads

TensorFlow Lite Flutter plugin provides an easy, flexible, and fast Dart API to integrate TFLite models in flutter apps across mobile and desktop platforms.

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

ffi, flutter, path, plugin_platform_interface, quiver

More

Packages that depend on tflite_flutter_custom

Packages that implement tflite_flutter_custom