Use PaddleHub combined with PaddleOCR to realize license plate recognition

introduce

  • License plate recognition is to recognize the text information on the license plate, which is a subtask of optical character recognition (OCR).

  • License plate recognition technology has been widely used in traffic facilities such as parking lots, toll stations, etc., providing efficient and convenient vehicle authentication services

  • OCR is generally divided into two steps

    1. Detect text position in image
    2. Identify the text information in it
  • The general process of license plate recognition is as follows:

Show results

insert image description here

[{'license': '苏B92912', 'bbox': [[131.0, 251.0], [368.0, 253.0], [367.0, 338.0], [131.0, 336.0]]}]

insert image description here

[{'license': '苏DS0000', 'bbox': [[260.0, 100.0], [546.0, 104.0], [544.0, 200.0], [259.0, 196.0]]}]

insert image description here

[{'license': '豫U88888', 'bbox': [[198.0, 185.0], [357.0, 186.0], [357.0, 243.0], [198.0, 242.0]]}]

online trial

quick use

  • Ps. PaddleHub quick calls are temporarily unavailable and will be supported soon
# 安装依赖包
$ pip install paddleocr==2.0.2 paddlehub==2.0.4
# 导入 PaddleHub
import paddlehub as hub

# 本地加载模型
model = hub.Module(directory='Vehicle_License_Plate_Recognition')

# 设置待预测图像路径
img_path = [path to img]

# 模型预测
result = model.ocr(img_path)

# 打印结果
print(result)

Guess you like

Origin blog.csdn.net/jm_12138/article/details/114437457