/maix_dock_mnist

Demonstration of handwritten digit recognition using Maix Dock M1 powered by Kendryde K210

Primary LanguagePythonApache License 2.0Apache-2.0

Handwritten Digit Recognition using Kendryte K210 and Micropython

Segmentation and inference on sample image

The Kendryte K210, used in the Maix Dock and other Sipeed boards, is an affordable and powerful alternative to other popular microcontrollers like the OpenMV boards. This repository showcases its capabilities in performing image segmentation and recognition tasks efficiently using MicroPython. For more information, please read my article: https://ashishware.com/2024/07/21/k210_digit_recognition/

Prerequisites

  1. Kendryte K210 board (example Maix Dock M1) with camera and display(optional)

  2. The board should be running latest MaixPy V1 firmware (maixpy_v0.6.3_2 at the time of writing this readme)

  3. Pretrained model on MNIST dataset.

  4. The above mentioned firmware should be loaded to the board and the model should be burned to the 0x300000 location on the flash memory using kflash-gui tool.

  5. MaixPy IDE installed and connected to the board.

  6. The sample image used in the experiment

    The sample image used as input

How to run

Copy the program from code.py and run it using the MaixPy IDE . Write down some digits on white paper with black marker (as shown above) and put it in front of the camera. The board will segment the image, attempt to recognize each digit and should produce output similar to the one shown below. If required adjust the thresholds for blob detections using the, Threshold Editor window in MaixPy IDE

MaixPy IDE showing output

Known Issues

  • If you are using Ubuntu and your board gets disconnected frequently, try uninstalling brltty

    sudo apt remove brltty
    
  • I was unable to get picture from the board in the 'Frame Buffer' window of MaixPy IDE, so I added print(img2.compressed_for_ide()) line in code.py and ran the code using Serial Termial in MaixPy IDE