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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-2.0.2-cp311-cp311-macosx_10_9_universal2.whl (403.3 kB view details)

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

marearts_anpr-2.0.2-cp310-cp310-win_amd64.whl (191.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-2.0.2-cp310-cp310-macosx_10_9_universal2.whl (403.3 kB view details)

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

marearts_anpr-2.0.2-cp39-cp39-win_amd64.whl (214.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-2.0.2-cp39-cp39-macosx_10_9_universal2.whl (406.2 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0e09d5eb39a16b2eea056fe42db68581dc01e4d901af3a0b539d54357aa7f256
MD5 b66b2cc13846379a60b69dc46ae43eed
BLAKE2b-256 43b5dd754d2cdff90cf3676bfff90aa503bd228b7a5941831aea8a3b07340e28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.2-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 112baadb01d707f07201a0a4cc7ea219144ca84f905b6c573d9f52df40cc641f
MD5 d737099567ea572ec42c7f27e9671030
BLAKE2b-256 8615691f8d554858dcff6d109db4d61c1e087aea059e7ccebbe7a3b06709c497

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.2-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 26a7c89d5ac329322b082a4f4cea816294e75b6702ad43a4fa025481fe47be3f
MD5 4d15d3cb63612f2eeba8d8fc9423c9f8
BLAKE2b-256 5b2410bee47d76abaf9a4d35ed9367b6a55d7160f3f31304a3b3ae5c953ce1c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 af99547b8ae604a12bbd4b164d22d56aee1b82d44c9bf4c9ed565a8a37d9f05c
MD5 5f6e226f1c46fdd7a875345b1e7751b2
BLAKE2b-256 2d0e64300afb2ed5f4d6fe1107fd7888cf1100c6393548f64bba1e6814a57712

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.2-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e054c5a997e24e1a6b089fda7fc0d687f62e1a5a28db7057bf99d4c7f0755979
MD5 4ccd06bb5a3a6a527ebce1a4780c8466
BLAKE2b-256 8f35c42b2a61daaebfc979adf5c370d7debdf85f463cb3802e296e71fa773d47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.2-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 acc6161512743508f75393cf15e04087dac62ac1f900b59c898e6d540aed3bd8
MD5 67f2d757afd5b45b0fd234a0671c684a
BLAKE2b-256 7857b685214fc5f9b3d0df8728c776451f270444be23c27cc3de099750a2dc93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e00bbf859b52cb69e5f0c37b5b756542dd368b919e39589b17fb4dd863970902
MD5 4ee1dbd0841d05523fbcefe3ca379e94
BLAKE2b-256 0f8cb2243c509912a366b20d1cfbcf0175b4b8840d0a2273e5fca01157290575

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f0b6e3678c62f68eb14aaf9246409f52c6be0c1c407e8f8685e2e22d06c2c6bc
MD5 0e9a92a385593f20e083727d4ae3ab3e
BLAKE2b-256 fb6cd7d856f204dd89a9d3ca65ebbdfa181e7d2391da1c7cf75cbc7c83c48bc8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.2-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ea13176b67c7a4e76b7d7ae48440a7ce0405cd05b7b221a22b10701d4cef3f3b
MD5 9770308d4e35232697b3fd159c92a3a0
BLAKE2b-256 826708761d3be1f21c98bc51de503b9d017afa871fbf037987b6656f99531a47

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