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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-0.0.1019.1-cp311-cp311-macosx_10_9_universal2.whl (401.4 kB view details)

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

marearts_anpr-0.0.1019.1-cp310-cp310-win_amd64.whl (190.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-0.0.1019.1-cp310-cp310-macosx_10_9_universal2.whl (401.3 kB view details)

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

marearts_anpr-0.0.1019.1-cp39-cp39-win_amd64.whl (214.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-0.0.1019.1-cp39-cp39-macosx_10_9_universal2.whl (404.2 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4a90dd315cde0b8914e3a6c1d7d652fd2bc571eb81e28642e2334fae97731859
MD5 c11387441ebb34477362c9a68b907eb6
BLAKE2b-256 12b5fe1bff326a3cbbc056591503a1ff3fe5ca8fe0dbeb77d5643b47ca5961a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 04d6a732a026597b5e6ac21cb8cba5f29a2f860109eb7947d45883ebdfc37c1c
MD5 cf00bbefb41e849ac6b45e44c16067b9
BLAKE2b-256 44faeac46f7b4164e3fb7a25ca916e378d312ff0f358d5d01baf8071ba27e1cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 43604b246cfa8d125173d233667877f916522b8e1600d795ee95ba161d8c3b80
MD5 bd99a445b3ab70ad9d6a1176ff523e23
BLAKE2b-256 172983b7c63a50c4f3ffc83ebc161cba3158656643ac6d58ab973d47c70aff57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 57a62ad7c2077862846a3c1a1ea3a4fe8fc499d2ed23c3a4b453913c2ae2a6b0
MD5 6b586a2d12b84d367dcbfffe60e66035
BLAKE2b-256 e55b2977ed01d2e5ebb4821e76bb3e9153858544463bfab8d32c5308f397578c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ae40436d9ce22078e1de74eb50797369b196a0c48c9c6de56cb19c6081a5b191
MD5 70f0f493af194b7544c83bad2ed4f129
BLAKE2b-256 60f98efc132701ed5e121908dac8407b977cbbfff78480c85a6ffb13057c2ae2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 02be240e4443bc2a1f6616aab91a0f0acf5d86068432e496a286995dc0d53596
MD5 a00e5058ea30b43fd311268eb282d9e7
BLAKE2b-256 2defea1d1c344a5ac265ae8eb8c74256725c4bbbf6c3cd27d190838920192616

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0c02e89d18afa0a5a359c314c8e895fd61096a5d2ec3839b2f72bd0e25e880a4
MD5 5aaec436c59556e04a5021b2ad942623
BLAKE2b-256 a53575d4a400d7cc8a63649bd822f5ab027eaf7b380cce861c7b5b00afadf401

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 825fc39a5cb13e3937ea54d609fd9749e0dc4e73a5a96ecf3b5b1d528674d791
MD5 a652fdcd9481b596d5776a3eb15738f2
BLAKE2b-256 ce7a8f7053770228717e94ba15b888ee8d3854f69be788ca49ac35d44a99ade9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 54efc42b3c8b8f85089381814fc1c95ee89ee7b3288546bb3c2240a388b7856e
MD5 9ce677ad5c543473d6416475d12ebbaa
BLAKE2b-256 4db5e0a3bfba9638fa8042017428d24e059f94b3475b3f55e7a6dbd6c397fc28

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