fengwang / EfficientNetAndroid

Deploying EfficientNet to Android platform using flutter-tflite
2 stars 1 forks source link
android efficientnet flutter image-classification tflite

Image classification with flutter tflite

This is a demo application showing how to deploy a image classification model to Android using flutter-tflite.

Building the app

Fetch code and model

git clone https://github.com/fengwang/EfficientNetAndroid.git
cd EfficientNetAndroid

Adjust flutter toolchain

flutter channel stable && flutter upgrade

Build Android app

flutter build apk -v

Screenshot

Model

The EfficientNet model is taken from keras model zoo. The conversion is quickly done using tflite converter without considering quantization/prune:

import tensorflow as tf
env2s = tf.keras.applications.EfficientNetV2S(include_preprocessing=True, classes=1000, classifier_activation=None)
converter = tf.lite.TFLiteConverter.from_keras_model(env2s)
tflite_model = converter.convert()
with open('./assets/env2s.tflite', 'wb') as f:
  f.write(tflite_model)

License

MIT