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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-3.0.20-cp311-cp311-macosx_10_9_universal2.whl (394.0 kB view details)

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

marearts_anpr-3.0.20-cp310-cp310-win_amd64.whl (187.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-3.0.20-cp310-cp310-macosx_10_9_universal2.whl (394.3 kB view details)

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

marearts_anpr-3.0.20-cp39-cp39-win_amd64.whl (211.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-3.0.20-cp39-cp39-macosx_10_9_universal2.whl (397.0 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.20-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a6e0e5d8ea9e0038c309e0c59ae97dd813ed0424de599c9cb4ea796043b457bd
MD5 e12e7d53e4c74b633235dffd3ce087ee
BLAKE2b-256 d2244084a2b9efebaa1b954e3190619eac590662a3d805edee7db821e3718607

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.20-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b475812ec6dcaf324482fdfb80e98f78d12d661928c8593006ef2bb2f531d347
MD5 4239b4c5af8cbb9ecf630585a009b1e8
BLAKE2b-256 cfd965a2f156c1bbfd6edf3146e9a5d4e4ffe24190e7806cebd40793647c32c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.20-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6d79305e23a0da9b0ac4b2be5991ba847caaea9fe6cf4f416f8f50ef3dac915f
MD5 9b917fa27ec038ec4b8c63c9c4f4626d
BLAKE2b-256 446aabea78b2ef7c684cd6935ff630582a63a80e4676fbbbe2161dc592340e26

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.20-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 38b5460bba45fe9f3a66922c71395d4d8e9284aaa8bcb8e39d570508d64cefa7
MD5 f9748e06d1e440014be795958cdbd3a2
BLAKE2b-256 516a09c290c1f69d180f0e513000fc9cea1761859f66f8721cf9b3087810d248

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.20-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05836385262beaeebfaa8ecaad75a60151f8758243ca2c0917525b193d8f6fee
MD5 e2933f831b6cb47ce8306ee9769907f3
BLAKE2b-256 4fa770ae805031f104d19b6091a27c6890061e72efb54e3b6e9892386ed87cfa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.20-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 145b78c27bd0502998c75bf9c9aac2cc3b3edc5264e406fd21e7edfc1be9d7e7
MD5 a37758f2aae179b4719ac243dc613229
BLAKE2b-256 06abb56bee7e40d668e05f71f5c72169dd2dd87af9b3756011bcf7fb80a7ebfe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.20-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8b1a18ee82c2708d1f31f3572014300aa0f34624622fef4724a28521b34af8bf
MD5 9826eb8200880a3494ce20dba3124f05
BLAKE2b-256 a225b1dd9f926076a96c6650ce5448b73db3f182d6e016353aa4826666a7562c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.20-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7fee1438fbb7bcdea7940289f9d3429bb2e7bd72a0b89366d67e84c9828f919f
MD5 081d834f0a8dbc43661f0a4e24c305ab
BLAKE2b-256 f88f1fe5d9f9adcd96615e49bd35b85be9cee5ffe2cb80a74193f18cd2ba5d35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.0.20-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f55f54703c6a7c779bcad02bba696ef05014d6ae35a7fcc60a2de91e989cbfda
MD5 b9069652c6199592abaf1c65e9501656
BLAKE2b-256 4e2e4d75c30970734ace6f1c5b838968bb6f99ff8c941a74050e4fee3d852fd5

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