This is a demo application showing how to deploy a image classification model to Android using flutter-tflite.
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
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)
MIT