Back to Tensorrtx

LPRNet

lprnet/README.md

latest1.5 KB
Original Source

LPRNet

The Pytorch implementation is xuexingyu24/License_Plate_Detection_Pytorch.

Usage

  1. download model from HERE and put it into models folder

  2. use genwts.py to generate wts file

bash
python3 genwts.py
  1. build C++ code
bash
pushd tensorrtx/lprnet
cmake -S . -B build -G Ninja --fresh
cmake --build build
  1. serialize wts model to engine file
bash
./build/LPRnet -s

now you may see LPRNet.engine under models

  1. run inference

sample code use the image under assets by default:

bash
./build/LPRnet -d

output looks like:

bash
...
Execution time: 205us
-65.58, -28.74, -52.1, -70.79, -53.36, -57.58, -70.97, -60.66, -48.18, -57.38, -54.07, -58.56, -49.04, -52.39, -51.94, -53.4, -49.04, -45.89, -49.42, -7.863, -42.12,
====
Execution time: 202us
-65.58, -28.74, -52.1, -70.79, -53.36, -57.58, -70.97, -60.66, -48.18, -57.38, -54.07, -58.56, -49.04, -52.39, -51.94, -53.4, -49.04, -45.89, -49.42, -7.863, -42.12,
====
result: 沪BKB770

Note

if you are running this demo on windows, you may need to check the code page, e.g., for Windows PowerShell, run:

ps1
chcp

if the output is not 65001, then use

ps1
chcp 65001

to set the code page to utf-8, so you can get the correct literal result.