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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-3.0.18-cp311-cp311-macosx_10_9_universal2.whl (393.9 kB view details)

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

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

Uploaded CPython 3.10 Windows x86-64

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

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

marearts_anpr-3.0.18-cp39-cp39-win_amd64.whl (211.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-3.0.18-cp39-cp39-macosx_10_9_universal2.whl (396.8 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.18-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ffeb5a066a1b8ba9f2096b08222758e7ac848ea1e85fc3a5661a0cbf13abf3d5
MD5 43dfc8c711bf3d257373ed56afe31670
BLAKE2b-256 07a8bd1ae4daafe8c9a35318ba54d866882d9917db89bcc352ae46827f460b49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.18-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 295e7023566c6fcd6f37e9b37810320527b252e35b9863b89d095fb114556c91
MD5 d1e03041bc3c552b375012b2e043a75e
BLAKE2b-256 256e7300dbda3f4d7b1f540d9f7ce01a1305625f5d19d355b56a41e28a57438c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.18-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 85584a8a668873d45c840e63761412d58f13fe90e9f1207dd982a6d8cef11791
MD5 bd751075cd9a3fc6a30b1fcff8567f0c
BLAKE2b-256 5b4d7eb0df55a1a42bdcc1aa13fa13406fec993eb50d16b7b924c19757c74a80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.18-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fd7748d9a825553ca7ad7bd72b7ba4c1986bb54d0d4ba213b67dcc72d307aa47
MD5 526fe757b9ad5c2b198f7b054c7a3572
BLAKE2b-256 1264357e0c33a2728fd83641de33daf7561f5f7f6fc6037deb2f4a410e1a9658

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.18-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9d25993b1fcf01047266ddf264e067d5d455a18e6d64f2370c91e1fa840447fb
MD5 05dc1b2aeaf7af908fc91093bddd1d4d
BLAKE2b-256 7712e4ef22ac470c5dec6398806157e37a330e6764b28f8aeba6ac8e18ec349c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.18-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 be795d30d8c7a6867d809c2503f39d99970057cb6c475f6e99f4c9aefe679a05
MD5 accecdeb92d1757128d58d1cec5c93f3
BLAKE2b-256 50cc9311e1c494e50108c4d37235d77f03f76e59c4ff08115857736bddf2cb83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.18-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 547d7471a3ace69f02d6db5a76b4ba80f613753c1a5c1c95620d70f17213926a
MD5 aabad13edd82dcd23ee16da632c613cf
BLAKE2b-256 1311ee6a4483382393e0ec6129dc9488bbcb58eb47b42f5962355ede7a3b4424

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.18-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 404a795ff2ed91af703c47db16890056a6b288434232796a709a6aa16103e0c5
MD5 f04bb9845aee74fcf2315102c15d40f2
BLAKE2b-256 c171520fa253ab3a8c8ce6dff7431b0474bbf79a72b9f9221f576d78dcfe1b22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.18-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 8beb532b634f2c8ebd33473ca6d88d06aceb0c6008000e986aa6a8380748c7eb
MD5 01afb95ca0d5e5fbbfe7827baf1d4cc3
BLAKE2b-256 65fd4471a36ced8f93daaed646e70b3897552c768e318a6a27b4ecf9897d54c8

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