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.1009.2-cp311-cp311-win_amd64.whl (190.4 kB view details)

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-0.0.1009.2-cp311-cp311-macosx_10_9_universal2.whl (399.9 kB view details)

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

marearts_anpr-0.0.1009.2-cp310-cp310-win_amd64.whl (189.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-0.0.1009.2-cp310-cp310-macosx_10_9_universal2.whl (399.8 kB view details)

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

marearts_anpr-0.0.1009.2-cp39-cp39-win_amd64.whl (213.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-0.0.1009.2-cp39-cp39-macosx_10_9_universal2.whl (402.8 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4150b956c3590baaf04306f783e88cfcd02dc464bae7a86ac10077ba3ed13ed5
MD5 702bcc87932c6bbc022f9b56e0fdfe51
BLAKE2b-256 6e8b28256386e45949ada8893da3a2642b946f3a116fbf96ed05002da9c37fc4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.2-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8be00ad894819bcc1652f2f982e9b63f98776a25364e9d887efef9885631d795
MD5 df454c15bddb6cc67ee38be8a15cc829
BLAKE2b-256 280f9a3e83d80e5eef4c3740ccc5905b9138a1c9a2ded5429fc707289030c093

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.2-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 159632e7a3f358c5c9be1e481011529d8b4db5dda75d0d0c1be7534565c7a088
MD5 3e93da3a06b02b1df6ff6efbccba144e
BLAKE2b-256 bdf142eacb880f30df6a85040589deff44619c89f534ae0cea5fb8939da7c2b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 90ddf1f14f8a2d3bcbbba2e4d197869094f17957bc5144a4970a39bf22965d65
MD5 c17eccb2bba74d8be765a3a976b1383d
BLAKE2b-256 3a32bbe428063c7cd84aa522cc45678e5d370bbc05c063ee288354a4fd2a0a55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.2-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b5f4a6d2eba03d9d964c18bdeefbb28a1fd03e1413cbe70d99a4650e0f47d040
MD5 a01a097779f635abe01f458dab6f1d05
BLAKE2b-256 e79e606cb852821d6d99bf84d6bd2f1643c765a0917ca0873971622e28c05bdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.2-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f37149bcd8a6e205ebca1e3e94c95ec23cc21f0970898abc43176a3432f621a2
MD5 cc8208ce3739a6e4d06e2003e5e6dadb
BLAKE2b-256 298cc95a35563800728cf5059c3f79e3f53eb0798d405fda10ead4352b91b068

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0beadd886959439618d23bf5f59ff84c823d8681a441763b821a9ee546d5de09
MD5 aa86c8fc7100999aacf7fc45d5a63938
BLAKE2b-256 96f6a512ea10f48000817f7bfdca26c0995c7a7540c14f2792456fce64766b8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 58bb6321ce80407d83592809d2832bfa066d1cfbde7cbca44a8ac4ef0e5779fc
MD5 a49be28b3fa43f438e36b45bf739fc89
BLAKE2b-256 c1d8cc24e254fe887c94572c742e333201adf32443ae322112635d9f00270612

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.2-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 171b9785d3a9bf77d3c5cd651d30c00241813b44ea7abc588b99b264240a6bbd
MD5 c357229b3883210283c32de93b1e62fe
BLAKE2b-256 1962fce3deeebf6308160b414d5465e33595fef28db82a4119b69fa7f1dbff2e

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