ArmNN and TensorFlow base mnist-draw
MNIST-Draw is a funny single page website that enables users to hand-draw and classify digits between 0 and 9 using machine learning.A machine learning model trained against the MNIST dataset is used for classification.
The project is a modified version of mnist-draw, which uses the Arm NN SDK to perform inferences on an Arm Cortex-A CPU.This model is configured for MNIST data inputs. The default model is optimized_mnist_tf.pb.
Please follow below procedure to implement mnist draw.
1) Environment: SP7021 platform+Raspbian(Please refer to How to build and install SP7021 Linux image to run Raspbian on SD card)
2) Download mnist-draw source code, armnn and tensorflow library
$ git clone https://github.com/sunplus-plus1/armnn_test.git
3) Extract armnn and tensorflow library
$ cd armnn_test
$ tar -xzf armnn-dist.tar.gz
4) launch Python server
$ cd mnist-draw
// Set LD_LIBRARY_PATH for Arm NN (if not already done)
$ export LD_LIBRARY_PATH=/home/pi/armnn_test/armnn-dist/armnn/lib
// Start Python server
$ python3 -m http.server --cgi 8000
5) Input setting
Then open a browser on any machine which can access the SP7021 board, and go to http://ip-address:8000
For example, native machine connect to python server, please set http://127.0.0.1:8000
6) Result
Operation flow:
a) Press left key of mouse to write number 0~9 on the canvas
b) Press "Predict" to start predict
c) Press "clear" to clean canvas