• Stars
    star
    216
  • Rank 183,179 (Top 4 %)
  • Language
    Kotlin
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MNIST with TensorFlow Lite on Android

MNIST with TensorFlow Lite on Android

Open In Colab

This project demonstrates how to use TensorFlow Lite on Android for handwritten digits classification from MNIST.

Prebuilt APK can be downloaded from here.

How to build from scratch

Environment

  • Python 3.7
  • tensorflow 2.3.0
  • tensorflow-datasets 3.2.1

Step 1. Train and convert the model to TensorFlow Lite FlatBuffer

Run all the code cells in model.ipynb.

  • If you are running Jupyter Notebook locally, a mnist.tflite file will be saved to the project directory.
  • If you are running the notebook in Google Colab, a mnist.tflite file will be downloaded.

Step 2. Build Android app

Copy the mnist.tflite generated in Step 1 to /android/app/src/main/assets, then build and run the app. A prebuilt APK can be downloaded from here.

The Classifer reads the mnist.tflite from assets directory and loads it into an Interpreter for inference. The Interpreter provides an interface between TensorFlow Lite model and Java code.

If you are building your own app, remember to add the following code to build.gradle to prevent compression for model files.

aaptOptions {
    noCompress "tflite"
    noCompress "lite"
}

Credits

More Repositories

1

FlowLayout

A flow layout for Android with auto-spacing.
Java
2,392
star
2

ToggleButtonGroup

A group of flowable toggle buttons, with multiple / single selection support and button customization.
Java
418
star
3

NotificationBadge

A notification badge with animation.
Kotlin
317
star
4

machine-learning-exercise

Python implementation of the programming assignment from Machine Learning class on Coursera, which is originally implemented in Matlab/Octave.
Jupyter Notebook
83
star
5

android-examples

Java
36
star
6

tfmobile-mnist-android

MNIST with TensorFlow Mobile on Android
Python
10
star
7

NppLogGazer

Notepad++ plugin providing fancy search features for log analysis.
C#
8
star
8

tfserving-mnist

TensorFlow Serving model for handwritten digits classification from MNIST.
Python
6
star
9

PopularMovies

Udacity Developing Android Apps course project.
Java
4
star
10

kotlin-reference-cn

Kotlin 文档的中文翻译
3
star
11

NppQuickSearchPanel

Notepad++ plugin for quick search.
C#
3
star
12

ToShakeList

Java
2
star
13

Shalarm

Java
2
star
14

PopularMoviesKotlin

Kotlin
1
star
15

tflite-model-maker-flowers

Kotlin
1
star
16

garbage-classification-android

Kotlin
1
star
17

coursera-spa-with-angularjs-assignment

Assignment for Single Page Web Applications with AngularJS by Johns Hopkins University on Coursera
JavaScript
1
star
18

ExpandableCircleView

A circular progress indicator that expands or shrinks the circle to the given progress.
Java
1
star
19

tensorflow-exercise

Jupyter Notebook
1
star
20

think-bayes-playground

Jupyter Notebook
1
star
21

CheckableGroup

Java
1
star
22

oj-exercise

Exercises from various OJ. Releated articles can be found at http://blog.nex3z.com/tag/acm/.
C++
1
star