Using PIP Python Package

iApp Technology just released a PIP Python Package on Thai Driver License Card OCR.

For easing the python development using iApp AI API service, we have released the iapp_ai python pip package. It is the api client library for iApp AI API service for python.

Installation

$ pip install iapp_ai

Note: It can be either pip or pip3 depend on your environment.

Calling Thai Driver License OCR API

# api required a file path
api.driver_card_ocr("media/driver_card.png")

Example Usages

import iapp_ai


# You can request API key at https://ai.iapp.co.th
apikey = 'XXXXX_Your_API_Key_XXXXX' 

api = iapp_ai.api(apikey)

# api required a file path.

result = api.driver_card_ocr("media/driver_card.png").json()
print(result)

# {
# 'en_country': 'Kingdom of Thailand', 
# 'en_expiry': '26 march 2024', 
# 'en_issue': '26 march 2019', 
# 'en_name': 'mr iapp techlogy', 
# 'en_number': '00000000', 
# 'face': '', 
# 'file_name': 'driver_card.png', 
# 'flag': 'Detected', 
# 'id_card': '1111111111111', 
# 'inference': '0.790', 
# 'message': 'Success', 
# 'registrar': 'นาย ทะเบียน กรุงเทพมหานคร bangkok', 
# 'sign': '', 
# 'status_code': 200, 
# 'th_country': 'ประเทศไทย', 
# 'th_expiry': '', 
# 'th_issue': '1 มกราคม 2562', 
# 'th_name': 'นาย ไอ แอ พ พ์ เทคโนโลยี', 
# 'th_number': '00000000', 
# 'th_type': 'ใบ ขับ รถยนต์ส่วน บุคคล'
# }

Full Example in Google Colaboratory

Last updated