The AI reads images of license plate and converts them into text.
Beta version: The platform is in a development stage of the final version, which may be less stable than usual. The efficiency of platform access and usage might be limited. For example, the platform might crash, some features might not work properly, or some data might be lost.
OCR License Plate model or Automatic License Plate Recognition (ALPR) consists of two parts: License Plate Segmenter and the OCR Engine. First, the input image is parsed through the License Plate Segmenter to segment any license plates found in the image. Then, each license plate is cropped before passing through the OCR engine which will extract the plate number and province and store in the JSON format.
Although the system can read license plates in a clear and of decent quality images accurately, there are still some conditions that might negatively affect the performance of the model. In the case where the images are of low-quality or there exists in that image a small license plate that takes up very few percentages of the image, making it difficult to be read even by humans, there can be an error made by the system whether in the OCR part or the Segmenter part as well. Furthermore, in this version, the system is developed in the purpose to support only 4 types of license plate namely the normal type, the van-truck type, the no-province type , such as embassy plates or the plates of vehicle in government organizations which does not specify the province it is registered to, and the motorcycles type.
1. Normal Type
2. Van/Truck Type
3. No province Type
4. Motorcycles Type ( In our current version, the system is still unable to extract the province from old format of motorcycles plate in which the province is displayed as its abbreviation such as ‘กท’ for ‘กรุงเทพมหานคร’)
Other types of license plate are not considered in this system and the system might yield incorrect result if provided with input image containing other types of license plate.
The model is evaluated in an end-to-end fashion. There are two main metrics used: Character Error Rate (CER) and Exact Match Accuracy. In CER, the result is evaluated against the ground truth in terms of the percentage of error by character while exact match accuracy only considers the prediction to be correct when the prediction is exactly the same as the ground truth
The input image can be sent in a form of multi-part form data using the key name “files”. Here’s an example python snippet for requesting the API
import requests
def predict(url: str, img_path: str) -> dict:
files= [
('files', (os.path,basename(img_path), open(img_path, 'rb'), 'image/jpeg'))
]
response = requests.post(url, files,files)
return response.json()
When using the OCR LPR model, we recommend integrators to check whether:
If these conditions are applied, we can ensure that the model can perform best since it is within a desired environment for the model.
The output is a structured JSON containing 3 main parts. If there is more than one license plate in the image, the result would simply be appended to the list. The description of each field of a single license plate result are as follows:
The example of output is shown below.
[
{
'coord': [[233, 647], [343, 647], [345, 729], [234, 733]],
'ID': {'transcription': '6กฬ4877', 'confidence': 0.9959618074467549},
'Province': {'transcription': 'กรุงเทพมหานคร','confidence': 0.9890705347061157}
}
]