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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-3.0.28-cp311-cp311-macosx_10_9_universal2.whl (398.7 kB view details)

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

marearts_anpr-3.0.28-cp310-cp310-win_amd64.whl (189.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-3.0.28-cp310-cp310-macosx_10_9_universal2.whl (398.6 kB view details)

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

marearts_anpr-3.0.28-cp39-cp39-win_amd64.whl (212.5 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-3.0.28-cp39-cp39-macosx_10_9_universal2.whl (401.5 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.28-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d82a95fa2dd6ae3a9b60f159b919297d7e829bcd750602254a87f510a997fe86
MD5 556bcaf908f1ea10f38e5d6dcd09ebba
BLAKE2b-256 32cf1df1df55baeb6b967e88c718c78f4a549e5b57c2951a0ffe6c184344ef88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.28-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4fc606d9a5a5f0a1b77fd050f6c0a6579133c9319d4bf3897f58151578fefc88
MD5 7bbc75227eb247dda9fa865203c36f4b
BLAKE2b-256 a728c70a5140c3eba4ede20acd957c1d0dcc2f6b991abf7938e97774c282b2c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.28-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 91b9c0429a4fe967b336c582872a988fa7e6f55cb873a31758593c9a27c090ba
MD5 c0e35d658c894022f026e84c563159c1
BLAKE2b-256 91f2629dfc7a60466ad9f7ab7f09a3a9ceb8170e1d4b09f0345bffedbfa7c29e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.28-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6cc8e13d0b83926dd459decacb1404210a1ecf64bcd342167dce9413c6593a2c
MD5 1f67428a0dbbd1054e4446d1dc8c38e6
BLAKE2b-256 733d65774abaa470aa16993099e7220495567cc86eb4e632e8365f111c1b2ece

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.28-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fced049cafd43c2a6dde6c3f33739346d17ef83f4768582d47af2da1e4c4a1c7
MD5 c5e5f33cbe044b751168062259370167
BLAKE2b-256 719931dafdf5e21b7b117d9376bc051abf6811014a827f1c22e33f94d98bb03e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.28-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d514dd01ab5b48f52b86de5270f5ac30edde6b5e96e9583be5652aa1530a5383
MD5 f8618410aab91c3388e937534e351931
BLAKE2b-256 e856b10a06d48d297c2684384b63a944c3b4f048373943799f1fb72a3a0f7b11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.28-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8e9b8c543a8093757b0f4c6db81bc3e48603cf6030a236fb95d5e556f183681e
MD5 3dbabe064ff8124affe078ca81153303
BLAKE2b-256 2aa72ae5486c329e95b402a2359d25f2ab828f116c0e4bcc5f442614d776f1e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.28-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7f32d0f5ad3de4aa9adada096c7232686e802295bf64c0b199f705570eb3aac7
MD5 a5b939fbc12dff8319250ee5a3a338c6
BLAKE2b-256 53de138acde2f82b3c5417eafecb84fe6d1c443e3ca9febbb94e1ee78faff387

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.28-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 8a0ab6d2fd1aef954350ab209e0a11ade5b5d87b87ebb8f0d3b2845a3dd00d06
MD5 de67a6965898a14dc592f66373498547
BLAKE2b-256 a3f3e2ef8762420fbf487dc5ad41d3398c380b6042a11a27ae9ef77ec103e1f3

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