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

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-0.0.1019.2-cp39-cp39-macosx_10_9_universal2.whl (404.2 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.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f51323e8d71bac3b9a35115ee1e5341271195b1a1a2e3accc5d5cca7c914f6b9
MD5 8a9885c7dd5ce6be7c731ac743b09a7c
BLAKE2b-256 2eff9fab3df9ceece71bc4230512412a7643982d1ae399ce4c40fac4ed4d0ddc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.2-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 beded20816c34e7750678c26d79262d3989aec46290a2d0b43fdcc01d3007a0c
MD5 6c333af3e02f065213a2e7ee3e76fd93
BLAKE2b-256 b68f22a39172df8319d78ab46d66bede92d9c27f47d5eedbe4e99228ba03ce0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.2-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 47cf9e8dad832c597bca8d6781fb5a99857299d40674fc5f9e378da698ffaeed
MD5 8b6573202b0993a20b25f731c3903082
BLAKE2b-256 01549f64551893b3b2f6277b8502d044dbb179a386421ea5af9a5d06f93546d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ca725fbdc249aa9b2a40eb2dedf700a1e14965b6f54401eae62b1867573b423d
MD5 7fa3f173c7619590ab7bb23d0e6ef8c1
BLAKE2b-256 8ed4357c61dd8aa24c9a9cf113e6084b3fa0acf0b69b1b51720b9f519273a9ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.2-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7902c7d1f765e4da8014a2d6297727ba5daa40216e2cffb6b5d7211d219936d5
MD5 b318e8156df305ea7d55b090f92a1ceb
BLAKE2b-256 3d9d930da308845ea1c8549aa2e7bbcc1587252cbb0e55c27fa8c9de7083fe20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.2-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 48f6ec61732c0d31620b3c71db7736c6f806114db751ba30be92845129330459
MD5 c30ababd52253424fa69860cb852cb25
BLAKE2b-256 471c41b23782af82abfea18a603f60ca06df85765eb2d416c150154a3d5ab8df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a346847c9a77af639c6f81c42e65163aa96effc184e35a9fb54bfc1fcc3e5b29
MD5 bffc666fe61433bf36540e5907ad230e
BLAKE2b-256 144a5a3f1cb260eb080f323972466733157b7f7e8f10236d68e45f9afac412ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 73d0e230f176d3da311dc0cb2626a1d0aa4bbda6c601b80621da50b1bda92f66
MD5 9470b9faad46d4702ee6b2c232f2e9db
BLAKE2b-256 6d5439d059cb13ef7a1c0dc7f234f22a192870f5b5ee243ed1d24a5797ce2ff2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.2-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f850844b03c30bf82d88635f578ed17a9ff741961aca2996eda3cf82f818bfc5
MD5 a34fc075e87e7c4a00e159cab58d6829
BLAKE2b-256 38ac571e30542350b7f440e254aa4b4b05f4c05434f814f6210cfdd9d88f6717

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