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: not yet
    ocr_model_version = "eu" # Options: "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-3.0.7-cp311-cp311-win_amd64.whl (187.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-3.0.7-cp311-cp311-macosx_10_9_universal2.whl (393.8 kB view details)

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

marearts_anpr-3.0.7-cp310-cp310-win_amd64.whl (187.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-3.0.7-cp310-cp310-macosx_10_9_universal2.whl (394.1 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e5f5f4a07c37a03c0c1f86e894a9f78abafd26a87323e35fb77664a57925cf36
MD5 a78a18892b34db8bfa86baba112ebf0f
BLAKE2b-256 2ad4525508273bffab2f4c5e98d68dba08249db7f937e2571bca2ac3d8360251

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.7-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e37f93a8c281b48e9228b572f8be3d54280236c819d32ed8a86790bd6795c885
MD5 6087ed527a0d13c06fc07c14860b08cc
BLAKE2b-256 4a9f93832bacef7b64f38cf15a45b9d45c491b9183e7519e41370937ee966ceb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.7-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c02a7c29b0bafb09dd20c8ef35154a13ed272452a0421ff0a8460e32b6f1dc40
MD5 ef069b4bab29065d91950685db06ff2f
BLAKE2b-256 6944db0dfad4a9d4ff52cea745e2e4cf5b1a81df1e8ac7831e0202c8759a517a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4aef8139a74b6886e8ba4af132510d4afb09692938498170e20c8299e78061dd
MD5 fb782e65474098874d59e811a0fce104
BLAKE2b-256 881068a4062dc1c0b83fc2394598a3cd47ca59238b8b67eeb2d45c81ed73a7f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.7-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e7ed1638703722b0a63985357a858a3dfcbdd3657d30c9670ebb6f49122669eb
MD5 fa6b5d7a78f754e0b188487ca66108df
BLAKE2b-256 0eb6606cd3fb2ed6e9dfcd92c9cbd00b0ed4688e5de60fd83090759fbfb80219

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.7-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e5fbadcbb2412313eb3008cec748bb79244c9697cc446fb7fb14a103f1e44444
MD5 e7028e724f815cb874f9cc21ad98ebef
BLAKE2b-256 afc17838278ee88e71644d8c428da320dd238a84d24a9252b0f4c7b6dc0acd16

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