In the DSH plugin ecosystem, handling structured certificate information such as driver’s licenses usually requires writing additional parsing logic. xby-ocr-driver-license is a plugin focused on driver’s license recognition, maintained by xby-skill and categorized under model inference. It can directly extract key information from the main page and vice page of a driver’s license.

Function Description

The plugin provides the following core capabilities:

  • set_xby_apikey: Sets the API key in the chat. This operation automatically persists the key and it remains valid after the process is restarted.
  • ocr_driver_license: Recognizes the main page and vice page of a driver’s license. Requires an image file URL.
  • ocr_driver_license_for_data_base64: Recognizes the main page and vice page of a driver’s license. Requires the BASE64 encoding of the image file.
  • ocr_driver_license_for_data_file: Recognizes the main page and vice page of a driver’s license. Requires the file path of the image file.

The recognized fields include the driver’s license license number, name, gender, nationality, address, date of birth, permitted vehicle types, initial issue date, and validity period on the main page, as well as the file number on the vice page.

Installation and Configuration

Before using this plugin, obtain an API key.

  1. Get the key: Go to the Xiaobenyang official website to register and obtain an API key.
  2. Install the plugin: Run the following command to install it.
dsh plugin --profile web add github:xby_skill/xby-ocr-driver-license

After installation, the plugin is available in the current DSH process.

Usage Examples

After successful installation, you can invoke the functions with the following commands.

  1. Set the API key (required for first use).
set_xby_apikey <your_api_key>
  1. Recognize an image file URL.
ocr_driver_license https://example.com/driver_license.jpg
  1. Recognize a BASE64-encoded image file.
ocr_driver_license_for_data_base64 <base64_string>
  1. Recognize an image file path.
ocr_driver_license_for_data_file /absolute/path/to/image.jpg

Notes

  • License: This plugin is open-sourced under the MIT License.
  • Runtime permissions: The plugin runs with the permissions of the current dsh process. Before installing, review the source code and license to ensure they meet your requirements.
  • Data source: The recognition service depends on Xiaobenyang’s API endpoints. Make sure you have obtained a valid key according to the official website guidelines.