Nepali embossed plate character classifier

A small CNN (1.4 MB, 36 classes) that labels single characters on Nepal's embossed licence plates, with a one-file script (read_embossed.py) that cuts a plate crop into characters and reads it.

Nepal's newer embossed plates use Latin letters and digits (B AD 1484). Public Nepali plate models are trained on the older Devanagari plates and read embossed ones as nothing, or as a few misread digits. This model fills that gap.

Use

pip install torch safetensors opencv-python numpy
python read_embossed.py plate.jpg
from read_embossed import Reader
reader = Reader()
print(reader.read(plate_bgr))  # e.g. "BAD1484"

Give it a crop of the plate itself. Finding the plate in a photo is a separate step; any plate detector works. The province word above the number (e.g. BAGMATI) is not read.

How it reads a plate

  1. Threshold the plate (dark characters on a white plate) and take the dark blobs shaped like characters.
  2. Drop the red Nepal flag, small stickers and the province word, which are shorter than the registration characters.
  3. Put the pieces in reading order, allowing for tilted plates and two-line motorcycle plates.
  4. Label each piece with the CNN, allowing only Latin letters and digits.

Training data

Exact duplicate images were removed. The classes include the Devanagari digits and seven zone syllables (BA, PA, CHA, KHA, KO, ME, PRA) because the public crop sets contain them, but read_embossed.py only allows Latin letters and digits.

Results

Tested on cars that were never in training (the real plates are split by car, since several cars were photographed twice):

Test Result
Single characters cut from real plates (161) 92.5% correct
Whole plates, cut by their labelled box (30) 53% read exactly
Whole plates, through a full detector pipeline (30) 50% read exactly, 20% character error rate
Clean embossed crops from the theciceerguy test split (559) 99.6% correct

Before adding the real plate crops, the same network got 70.8% of real characters and 20% of plates right: models trained only on clean public crops do much worse on real plates than their own test sets suggest.

Limits

  • 30 test plates is a small sample; 50% could plausibly be anywhere from about 35% to 65%.
  • All real plates are parked private cars in Kathmandu photographed up close, not traffic-camera footage.
  • 30 of the 110 real plates still split into the wrong number of pieces; most errors come from that step, not from labelling characters.
  • Letters I, O, Q, U, V, W, X and Y never appear in the training data and cannot be predicted.
Downloads last month

-

Downloads are not tracked for this model. How to track
Safetensors
Model size
362k params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Dataset used to train notashwinii/nepali-embossed-plate-reader