English | 简体中文
License plate recognition has a very wide range of applications with vehicle identification functions, such as automatic vehicle entrance/exit gates.
PP-Vehicle supports vehicle tracking and license plate recognition. Models are available for download:
Task | Algorithm | Accuracy | Inference speed(ms) | Model Download |
---|---|---|---|---|
Vehicle Detection/Tracking | PP-YOLOE-l | mAP: 63.9 | - | Link |
Vehicle Detection Model | ch_PP-OCRv3_det | hmean: 0.979 | - | Link |
Vehicle Detection Model | ch_PP-OCRv3_rec | acc: 0.773 | - | Link |
PaddleDetection/output_inference
, and modify the model path in the configuration file. Models can also be downloaded automatically by default: Set enable: True of VEHICLE_PLATE
in deploy/pipeline/config/infer_cfg_ppvehicle.yml
Config Description of infer_cfg_ppvehicle.yml
:
VEHICLE_PLATE: #模块名称
det_model_dir: output_inference/ch_PP-OCRv3_det_infer/ #车牌检测模型路径
det_limit_side_len: 480 #检测模型单边输入尺寸
det_limit_type: "max" #检测模型输入尺寸长短边选择,"max"表示长边
rec_model_dir: output_inference/ch_PP-OCRv3_rec_infer/ #车牌识别模型路径
rec_image_shape: [3, 48, 320] #车牌识别模型输入尺寸
rec_batch_num: 6 #车牌识别batchsize
word_dict_path: deploy/pipeline/ppvehicle/rec_word_dict.txt #OCR模型查询字典
basemode: "idbased" #流程类型,'idbased'表示基于跟踪模型
enable: False #功能是否开启
#Single image
python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppvehicle.yml \
--image_file=test_image.jpg \
--device=gpu \
#Image folder
python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppvehicle.yml \
--image_dir=images/ \
--device=gpu \
#Single video
python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppvehicle.yml \
--video_file=test_video.mp4 \
--device=gpu \
#Video folder
python deploy/pipeline/pipeline.py --config deploy/pipeline/config/infer_cfg_ppvehicle.yml \
--video_dir=test_videos/ \
--device=gpu \
There are two ways to modify the model path
./deploy/pipeline/config/infer_cfg_ppvehicle.yml
, and modifyVEHICLE_PLATE
field to config license plate recognition model modification-o VEHICLE_PLATE.det_model_dir=[YOUR_DETMODEL_PATH] VEHICLE_PLATE.rec_model_dir=[YOUR_RECMODEL_PATH]
to config file in command line.The test results are as follows:
Performance optimization measures: