Git Product home page Git Product logo

lpr_jax's Introduction

Lightweight License Plate Recognition with JAX

License JAX Hugging Face

This repository is a JAX implementations of lightweight license plate recognition (LPR) models.

Data Preparation

The labeled data is required to train the model. The data should be organized as follows:

- data
  - labels.names
  - train
    - {license_plate_number}_{image_number}.jpg
    - {license_plate_number}_{image_number}.txt
    - ...
  - val
    - {license_plate_number}_{image_number}.jpg
    - {license_plate_number}_{image_number}.txt
    - ...

license_plate_number is the license plate number and make sure that the number is formatted like 12가1234, 서울12가1234 and prepare a dict to parse the every character of the license plate number to the integer. The dict should be saved as labels.names file. image_number is the number of the image and it is used to distinguish the same license plate number. The .txt file is the bounding boxes of each character in the license plate number. The format of the .txt file is as follows:

x1 y1 x2 y2
...
xn yn xn yn

The order of the bounding boxes should be the same as the order of the characters in the license plate number.

The dataloader will parse the data and convert the license plate characters to the integer using the labels.names file. The license plate images will be resized to (64, 128) or any other size you want. In addition, the mask of the license plate number will be created via the bounding boxes and the mask will be used to calculate the loss.

The losses of the model are as follows: $$ L_{total} = \alpha * L_{FocalCTC} + \beta * L_{CenterCTC} + \gamma * L_{DiceBCE}, \quad \alpha = 1.5, \beta = 0.01, \gamma = 0.5 $$

$$ L_{CTC} = -\log \sum_{s \in S} P(s|X) $$ $$ L_{FocalCTC} = \alpha (1 - P(s|X))^\gamma L_{CTC}, \quad \alpha = 0.8, \gamma = 3 $$

Benchmark

Model Input Shape Size Accuracy Speed (ms)
tinyLPR-s (64, 128, 1) - KB - - ms
tinyLPR-l (96, 192, 1) 80 KB 0.9926 0.71 ms

Ablation Study

lpr_jax's People

Contributors

noahzhy avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.