Skip to main content

MareArts ANPR (Automatic Number Plate Recognition) library

Project description

MareArts ANPR SDK

๐Ÿ‡ช๐Ÿ‡บ ANPR EU (European Union)

Auto Number Plate Recognition for EU countries

๐Ÿฆ‹ Available Countries: (We are adding more countries.)

๐Ÿ‡ฆ๐Ÿ‡ฑ Albania  ๐Ÿ‡จ๐Ÿ‡ฟ Czechia  ๐Ÿ‡ฆ๐Ÿ‡ฉ Andorra  ๐Ÿ‡ฉ๐Ÿ‡ฐ Denmark  ๐Ÿ‡ฆ๐Ÿ‡น Austria  ๐Ÿ‡ซ๐Ÿ‡ฎ Finland
๐Ÿ‡ง๐Ÿ‡ช Belgium  ๐Ÿ‡ซ๐Ÿ‡ท France   ๐Ÿ‡ง๐Ÿ‡ฆ Bosnia and Herzegovina  
๐Ÿ‡ฉ๐Ÿ‡ช Germany  ๐Ÿ‡ง๐Ÿ‡ฌ Bulgaria ๐Ÿ‡ฌ๐Ÿ‡ท Greece   ๐Ÿ‡ญ๐Ÿ‡ท Croatia  ๐Ÿ‡ญ๐Ÿ‡บ Hungary  ๐Ÿ‡จ๐Ÿ‡พ Cyprus   ๐Ÿ‡ฎ๐Ÿ‡ช Ireland

๐Ÿฆ‹ Recognisable Characters:

char_list = [
    "-", ".", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
    "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
    "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "d", "i", 
    "m", "o", "ร–", "รœ", "ฤ†", "ฤŒ", "ฤ", "ล ", "ลฝ", "ะŸ"
]

๐Ÿ‡ฐ๐Ÿ‡ท ANPR Korea

ํ•œ๊ตญ ์ž๋™์ฐจ ๋ฒˆํ˜ธํŒ ์ธ์‹ ์†”๋ฃจ์…˜

์ธ์‹ ๊ฐ€๋Šฅ ๋ฌธ์ž:

char_list = [
    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 
    '๊ฐ€', '๊ฐ•', '๊ฑฐ', '๊ฒฝ', '๊ณ ', '๊ด‘', '๊ตฌ', '๊ธฐ',
    '๋‚˜', '๋‚จ', '๋„ˆ', '๋…ธ', '๋ˆ„',
    '๋‹ค', '๋Œ€', '๋”', '๋„', '๋™', '๋‘',
    '๋ผ', '๋Ÿฌ', '๋กœ', '๋ฃจ',
    '๋งˆ', '๋จธ', '๋ชจ', '๋ฌด', '๋ฌธ',
    '๋ฐ”', '๋ฐฐ', '๋ฒ„', '๋ณด', '๋ถ€', '๋ถ',
    '์‚ฌ', '์‚ฐ', '์„œ', '์„ธ', '์†Œ', '์ˆ˜',
    '์•„', '์–ด', '์˜ค', '์šฐ', '์šธ', '์›', '์œก', '์ธ',
    '์ž', '์ €', '์ „', '์ œ', '์กฐ', '์ข…', '์ฃผ',
    '์ฒœ', '์ถฉ',
    'ํ•˜', 'ํ—ˆ', 'ํ˜ธ'
]

Installation

To install the MareArts ANPR package, use the following pip command:

pip install marearts-anpr

๐Ÿชช License Key

For private keys, please visit MareArts ANPR Solution. For inquiries about private keys, contact us at hello@marearts.com.

๐Ÿค– Live Test

MareArts ๐ŸŽฌ Live

๐Ÿ“บ ANPR Result Videos

Check here to see the license plate recognition results in YouTube videos.

๐Ÿ“ Using SDK

๐Ÿ”ฌ SDK Usage

Here's an example of how to use the updated SDK:

# pip install marearts-anpr
import cv2
from PIL import Image
from marearts_anpr import ma_anpr_detector
from marearts_anpr import ma_anpr_ocr
from marearts_anpr import marearts_anpr_from_pil
from marearts_anpr import marearts_anpr_from_image_file
from marearts_anpr import marearts_anpr_from_cv2

if __name__ == '__main__':
    
    #################################
    ## Initiate MareArts ANPR
    print("EU ANPR")
    user_name = "your_email"
    serial_key = "your_serial_key"
    detector_model_version = "middle" # Options: middle, v10_small, v10_middle, v10_large
    ocr_model_version = "eu" # Options: eu, kr

    # MareArts ANPR Detector Inference
    anpr_d = ma_anpr_detector(detector_model_version, user_name, serial_key, conf_thres=0.3, iou_thres=0.5)
    # MareArts ANPR OCR Inference
    anpr_r = ma_anpr_ocr(ocr_model_version, user_name, serial_key)
    #################################

    #################################
    # Routine Task 1 - Predict from File
    image_path = './sample_images/eu_test1.jpg'
    output = marearts_anpr_from_image_file(anpr_d, anpr_r, image_path)
    print(output)

    # Routine Task 2 - Predict from cv2
    img = cv2.imread(image_path)
    output = marearts_anpr_from_cv2(anpr_d, anpr_r, img)
    print(output)

    # Routine Task 3 - Predict from Pillow
    pil_img = Image.open(image_path)
    output = marearts_anpr_from_pil(anpr_d, anpr_r, pil_img)
    print(output)
    #################################


    #################################
    ## Initiate MareArts ANPR for Korea
    print("ANPR Korean")
    # user_name, serial_key are already defined
    # anpr_d is also already initiated before
    ocr_model_version = "kr"
    # MareArts ANPR OCR Inference
    anpr_r = ma_anpr_ocr(ocr_model_version, user_name, serial_key)

    #################################
    # Routine Task 1 - Predict from File
    image_path = './sample_images/kr_test2.jpg'
    output = marearts_anpr_from_image_file(anpr_d, anpr_r, image_path)
    print(output)

    # Routine Task 2 - Predict from cv2
    img = cv2.imread(image_path)
    output = marearts_anpr_from_cv2(anpr_d, anpr_r, img)
    print(output)

    # Routine Task 3 - Predict from Pillow
    pil_img = Image.open(image_path)
    output = marearts_anpr_from_pil(anpr_d, anpr_r, pil_img)
    print(output)
    #################################

๐Ÿ”ฌ Returns

The output from the ANPR will be similar to:

{
    'results': [
        {'ocr': 'SL593LM', 'ocr_conf': 99, 'ltrb': [819, 628, 1085, 694], 'ltrb_conf': 90}
        ], 
    'ltrb_proc_sec': 0.22, 
    'ocr_proc_sec': 0.15
}
{
    'results': [
        {'ocr': '123๊ฐ€4568', 'ocr_conf': 99, 'ltrb': [181, 48, 789, 186], 'ltrb_conf': 83}, 
        {'ocr': '123๊ฐ€4568', 'ocr_conf': 99, 'ltrb': [154, 413, 774, 557], 'ltrb_conf': 82}, 
        {'ocr': '123๊ฐ€4568', 'ocr_conf': 99, 'ltrb': [154, 601, 763, 746], 'ltrb_conf': 80}, 
        {'ocr': '123๊ฐ€4568', 'ocr_conf': 99, 'ltrb': [156, 217, 773, 369], 'ltrb_conf': 80}
        ],
    'ltrb_proc_sec': 0.23, 
    'ocr_proc_sec': 0.6
}
  • Results: Contains OCR text, probabilities, and detection coordinate(left, top, right, bottom).
  • Processing Speeds: Provided for license plate detection and OCR.

API for testing

This is for testing purposes

API key limits: 1000 requests per day.
User ID: marearts@public
X-API-Key: J4K9L2Wory34@G7T1Y8rt-PP83uSSvkV3Z6ioSTR!

API Call for EU

To make an API call for EU ANPR, use the following command:

#!bin/bash
curl -X POST https://we303v9ck8.execute-api.eu-west-1.amazonaws.com/Prod/marearts_anpr_eu \
     -H "Content-Type: image/jpeg" \
     -H "x-api-key: your-api-key" \
     -H "user-id: your-user-id" \
     --data-binary "@./path/upload.jpg"

API Call for Korea

To make an API call for Korean ANPR, use the following command:

#!bin/bash
curl -X POST https://we303v9ck8.execute-api.eu-west-1.amazonaws.com/Prod/marearts_anpr \
     -H "Content-Type: image/jpeg" \
     -H "x-api-key: your-api-key" \
     -H "user-id: your-user-id" \
     --data-binary "@./path/upload.jpg"

More Detail

email : hello@marearts.com
home page : https://marearts.com
blog : http://study.marearts.com
paypal : https://study.marearts.com/p/anpr-lpr-solution.html
live test : http://live.marearts.com

๐Ÿ™‡๐Ÿปโ€โ™‚๏ธ Thank you!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

marearts_anpr-0.0.1007.3-cp311-cp311-win_amd64.whl (190.1 kB view details)

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-0.0.1007.3-cp311-cp311-macosx_10_9_universal2.whl (399.7 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

marearts_anpr-0.0.1007.3-cp310-cp310-win_amd64.whl (189.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-0.0.1007.3-cp310-cp310-macosx_10_9_universal2.whl (399.6 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

marearts_anpr-0.0.1007.3-cp39-cp39-win_amd64.whl (213.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-0.0.1007.3-cp39-cp39-macosx_10_9_universal2.whl (402.5 kB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file marearts_anpr-0.0.1007.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1007.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6f364ec7667cbadb4a61804eb5afd97233eac74fdd3f79a3c8ccc7c1d25da45b
MD5 61df23c8c7cec23cabc7a92613d40d1c
BLAKE2b-256 d57d4f691104ab2d7e81cee26b94107066f0f7464c4ed9ca28732e1b9ffc2691

See more details on using hashes here.

File details

Details for the file marearts_anpr-0.0.1007.3-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1007.3-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ccf24eb4df91c60129a445de7ceee22c3e3f574d097dea3e91cf1c8b48eb523
MD5 c246f8a0846de53591638f9a610bd97c
BLAKE2b-256 59241181e0bb49c10d37f1c250c6ac91dec5360e127d5e396c1d5ffa060c47f3

See more details on using hashes here.

File details

Details for the file marearts_anpr-0.0.1007.3-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1007.3-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 93a5198a3da57e9c86e7df3e5573159e3ffca2e5d0decf0be4ed81c7aa47bae7
MD5 48100451458698ddc46c002d1a86cae6
BLAKE2b-256 f459e83456ea45915995d14bc6b58927713431659bb1199a632c12a34be5a99c

See more details on using hashes here.

File details

Details for the file marearts_anpr-0.0.1007.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1007.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5d55413c75e000b9ddd45fc4de500e5f0bd12fee72aacf7b08dbee1180ca9a15
MD5 59c8a30dee6045eb9c94f914e801a2ff
BLAKE2b-256 33b7ecfc5d5623da7a596d0c9854de8da3918d1f80fed1181fa2cecb7908f042

See more details on using hashes here.

File details

Details for the file marearts_anpr-0.0.1007.3-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1007.3-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b6e6d28a584d99d9edecab6c8d8376f58141d87dcc61648df06c6fa1d0fc2391
MD5 7d546995a361f7b71083182258b47688
BLAKE2b-256 1bfeacc9e45cb750253ddcbd73d290c0e66665574bd45e7fa9b15fb9e5d3fc07

See more details on using hashes here.

File details

Details for the file marearts_anpr-0.0.1007.3-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1007.3-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ebf45044eadad00d84ff28561a1658180061bb3b7c4bb9a464b697f7b4075d27
MD5 d9412e92073f6592c418ae3f99177120
BLAKE2b-256 e0cd9528a97067e6d1a7cec14c115ee27d9fe46541ea382da5dbb2318de301cb

See more details on using hashes here.

File details

Details for the file marearts_anpr-0.0.1007.3-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1007.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 38a955d991c7c26efbba16661bfe9a7e6e1dd52b70e7b30ac5e5aa95b41b6757
MD5 6acf94bd0be5f05c2ac1cde73404752d
BLAKE2b-256 192f4a37a0e87d99e225420b7c0b3a63a7aed1432885880a309c668b439883ad

See more details on using hashes here.

File details

Details for the file marearts_anpr-0.0.1007.3-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1007.3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f91bcf24b350571625c8e0403a44329f63c01b703f6ec8672363229d1143bba
MD5 62d4965833da503f1988112fcd003524
BLAKE2b-256 fb46a0e77c2a80e11a9090850051e39142b34e04c080af3129c8e65fd1c46ac0

See more details on using hashes here.

File details

Details for the file marearts_anpr-0.0.1007.3-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1007.3-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c7f6c9b5a8aee805d2b1b75d59915f695e664f3b9b80dbd224c3b2337ff214e3
MD5 5f45b7e5f0d334ce35c8d22a1d97c7a1
BLAKE2b-256 9be8b8f59d67c68e09bd445fe2dfcab98f26f60482dbd9523dbd38828e4aca25

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page