Link Search Menu Expand Document



The mnist network can be used for handwriting recognition for the digits 0-9.

This sample utilizes the OpenVINO Inference Engine from the OpenVINO Deep Learning Development Toolkit and was tested with the 2020.1 release.

The provided Makefile does the following

  1. Downloads a trained model
  2. Downloads test images
  3. Compiles the network using the OpenVINO Model Optimizer.
  4. There is a python example ( which runs an inference for all of the test images to show how to use the network with the OpenVINO toolkit.

This network is based on the TensorFlow 1.4 example.. The model was modified, trained, and saved in order to be compatible with the OpenVINO toolkit.

Model Information


  • name: ‘input’, shape: [1x28x28], Model uses grayscale images.


  • name: ‘output’, shape: [1, 10] - Output indexes represent each class probability.

Running this example

make run

The example runs an inference with the image one.png. Other digit images can be found in the data/digit_images folder.


Provided Makefile describes various targets that help with the above mentioned tasks.

make run or make run_py

Runs a sample application with the network.

make train

Trains a Mnist model for use with the sample. Training is not necessary since the sample will download a pre-trained model. This option allows for the user to further refine the Mnist model if they so desire.

make help

Shows makefile possible targets and brief descriptions.

make all

Makes the follow items: deps, data, compile_model.

make compile_model

Compiles the trained model to generate a OpenVINO IR file. This file can be loaded on the Neural Compute Stick for inferencing.

make model

Downloads the trained model.

make deps

Downloads and prepares a trained network for compilation with the OpenVINO toolkit.

make install-reqs

Checks required packages that aren’t installed as part of the OpenVINO installation.

make uninstall-reqs

Uninstalls requirements that were installed by the sample program.

make clean

Removes all the temporary and target files that are created by the Makefile.

This repository is distributed under the MIT License. Individual applications and networks may retain individual copyrights. Other copyrights and trademarks may be property of others. All rights reserved.