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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-0.0.1019.4-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.4-cp310-cp310-win_amd64.whl (190.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-0.0.1019.4-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.4-cp39-cp39-win_amd64.whl (214.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-0.0.1019.4-cp39-cp39-macosx_10_9_universal2.whl (404.3 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.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e8d2ccca6f1771e8b85babf913c6d24713308d341d3d61ec2d21e67003f8723e
MD5 c6e6f3a73059906cf04b0c4b1dfdef7c
BLAKE2b-256 dd1da22ca7440dfac052180c64833a457b481e4c73f427d323bb7f3eedcf9709

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.4-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3814d94ff40ab78accb2b870d973dd0a2656beaa69c520ab540f94b65be4888b
MD5 1308aa2ada59aad111a224f7d45ccea7
BLAKE2b-256 1488ae8094cd82c14159cf366a939dc0da335f32dd0e02213cef9aa6e3962a7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.4-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2ce070452ecf4e01abdf489a9343aaf33e7d444719c2e78630466951501febd3
MD5 8d49eb923db836d28a7d7534c3d8a942
BLAKE2b-256 28e80eb1b9ab20c04ae4f410f7945f68e35bf08b43516f9f61e8f9e33a9e20d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7d0dbbd1acc49c3a6bfc0206661e67846574914930955c5f56bda5a8eca65280
MD5 bd94789c020056eacc72941e4f55e91b
BLAKE2b-256 9a279fb4e0b15c29e686a2a480fd06aa50c63cdbf4063ced9573e428f27d2a38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.4-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3bbbcef7e9bb9bc0ec2ae2619dd6ea3a66fd9a7706ee3e3204952f8dc3db0cfb
MD5 1f68ad3d9be447e408f44073c907a4c1
BLAKE2b-256 a80a3e0643516c1b098d47274d5a799f839ffb3ff5ac1d10f65a38ff753e328a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.4-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b91580f313b1f6aa0d2a46be813c6c2ea5fe09a0c162dfc65d152c9138b2aaa2
MD5 a58ff584d0c872e4340d8b1c852fe641
BLAKE2b-256 1559e053bd39f9eba89b7ba053309ded21130ff0516681380ff953574c751d8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 cf260d6a4351670f1a246fcaab954a0ed21f2dc846434433d2bf6096c900aa8e
MD5 aa9cc7485767fd6adb76e0101a7828cb
BLAKE2b-256 a04962569434cc83dc18211312c7a6bb0c5e01c0d44a3e53667552a82afef223

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.4-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e28d5f2bb3d0d3f84a101de74352b82c758022a1e922b2838dbc808bc0b9a9d1
MD5 8ecb98b8e1180cc0ce9eec942bf772d9
BLAKE2b-256 4646c98aeb6e40ca8d6f02670075ab75ac9079f40e30ad9fb89a1c012ece8a25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.4-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 cef393857f5ec1f1d960af4d40bdf1b3f2112b7c62b4652a1280aafb126e090e
MD5 a3c7c468e0da3aace6dc71b319ed223f
BLAKE2b-256 6f81f0e2fe9380fb80497217de516535a984874ff2c3c8b1a63d99147f153334

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