Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 895 Bytes

README.md

File metadata and controls

29 lines (18 loc) · 895 Bytes

Optical Character Recognition with onnx web

This is a simple demo of how to perform OCR on the client side using ONNX web.

try it out !!

demo

Algorithm Overview:

  1. train a small CNN with PyTorch on the EMNIST dataset.

  2. Find optimal threshold for class confidence using AUC-ROC with FASHIONMNIST as negative class.

  3. quantize the trained model to 8-bit integer.

  4. convert the trained model to ONNX format.

  5. load the ONNX model in a web browser and perform inference on the client side:

    1. Binarize the image.
    2. perform clustering via flood fill algorithm.
    3. extract the bounding boxes of the clusters.
    4. resize and perform inference on the bounding boxes.
    5. compare prediction with confidence threshold.
    6. profit.

model performance:

confusion matrix