e2e-tflite-tutorials
e2e-tflite-tutorials copied to clipboard
Image Segmentation Android sample to support multiple models
Currently the TFLite image segmentation sample only supports 1 segmentation model trained on COCO dataset with mobilenet_v2_0.5 backbone.
However, there are many different versions of image segmentation with different backbone architectures and trained on different datasets. We'd like to integrate these models into the sample app and allow users to try different models by selecting them from the sample app UI.
Please directly contribute pull request to the tensorflow/examples with this enhancement.
Just to add a bit more details to the requirements - you can refer to these 2 examples:
- Image Classifier (Java, Camera2)
download.gradlefor downloading the various modelsClassifier.javaswitches the modelsCameraActivity.javahas the UI code to switch the models withmodelSpinner
- Cartoonizer (Kotlin, CameraX)
- Most of the code is in CameraFragment.kt with
modelSpinner. The project uses ML Model Binding so the classes for loading the models and creating interpreters etc are the generated classes underapp/build/generated/ml_source_out/debug/[package-name]/ml/
- Most of the code is in CameraFragment.kt with
FYI the TFLite team is working on updating the Android image segmentation model to demonstrate 2 ways of running segmentation models: with Task API and with Support Library + vanilla TFLite interpreter.
We should wait a few weeks before starting to work on this.