Base Flutter app for object classification using tflite

0 0

Flutter Image Classification

This app classifies images based on any TFLite image classification model.
A sample model has been provided to classify cats vs. dogs.

Instructions to use on your tflite model

  1. Install flutter & clone repository.
  2. Modify the model in assets/tflite/[name].tflite.
  3. Modify the class names in assets/tflite/[name].txt represent your classes (see example below).
  4. Modify both [name].tflite and [name].txt in pubspec.yaml (see example below).
  5. Change the loadModel function in lib/main.dart to load your [name].tflite and [name].txt (see example below).
  6. Run Flutter app. The tflite package uses v1 embeddings so we need to pass in –ignore-deprecation.
flutter run --ignore-deprecation

cats_dogs.txt

Cat
Dog

pubspec.yaml

assets {
    - assets/tflite/[name].tflite
    - assets/tflite/[name].txt
}

lib/main.dart

String res = await Tflite.loadModel(
    model: "assets/tflite/[name].tflite",
    labels: "assets/tflite/[name].txt",
) ?? '';

GitHub

View Github

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Deja una respuesta

Entrada anterior Building Travel and Aircraft Applications Build with flutter
Entrada siguiente A simple Login App with Flutter