mirror of
https://github.com/swdee/go-rknnlite.git
synced 2025-12-24 10:30:56 +08:00
LPRNet Example
Usage
Make sure you have downloaded the data files first for the examples. You only need to do this once for all examples.
cd example/
git clone https://github.com/swdee/go-rknnlite-data.git data
Run the LPRNet example.
cd example/lprnet
go run lprnet.go
This will result in the output of:
Driver Version: 0.8.2, API Version: 1.6.0 (9a7b5d24c@2023-12-13T17:31:11)
Model Input Number: 1, Ouput Number: 1
Input tensors:
index=0, name=input, n_dims=4, dims=[1, 24, 94, 3], n_elems=6768, size=6768, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=0, scale=0.007843
Output tensors:
index=0, name=output, n_dims=3, dims=[1, 68, 18, 0], n_elems=1224, size=1224, fmt=UNDEFINED, type=INT8, qnt_type=AFFINE, zp=47, scale=0.911201
Model first run speed: inference=7.787585ms, post processing=25.374µs, total time=7.812959ms
License plate recognition result: 湘F6CL03
Benchmark time=61.070751ms, count=10, average total time=6.107075ms
done
To use your own RKNN compiled model and images.
go run lprnet.go -m <RKNN model file> -i <image file>
Proprietary Models
This example makes use of the Chinese License Plate Recognition LPRNet.
You can train your own LPRNet's for other countries but need to initialize
the postprocess.NewLPRNet with your specific LPRNetParams containing the
maximum length of your countries number plates and character set used.
Background
This LPRNet example is a Go conversion of the C API Example
References
- LPRNet: License Plate Recognition via Deep Neural Networks - Original paper proposing LPRNet.
- An End to End Recognition for License Plates Using Convolutional Neural Networks - A paper that looks at LPRNet usage specific to number plates used in China.
- Automatic License Plate Recognition - An overview of creating a full ALPR architecture that uses; Vehicle detection (YOLO), License Plate Detection (LPDNet), and License Plate Recognition (LPRNet).