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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-2.0.3-cp311-cp311-macosx_10_9_universal2.whl (398.3 kB view details)

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

marearts_anpr-2.0.3-cp310-cp310-win_amd64.whl (188.9 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-2.0.3-cp310-cp310-macosx_10_9_universal2.whl (398.3 kB view details)

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

marearts_anpr-2.0.3-cp39-cp39-win_amd64.whl (212.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-2.0.3-cp39-cp39-macosx_10_9_universal2.whl (401.1 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f57bfa98984967b7343b202f5ad43ac1f08637457baab52b9c2bb39a634b8118
MD5 d6146de18103cbb8022a42ccf62710f8
BLAKE2b-256 6916b24373b42f869cff0261992ed80cbe5b2252829e841c10179cef55a3bc49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.3-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a8892d49e5087b75f139c11243c915f3f4d1f1105f968d18dc298d894c8a728
MD5 cd75b14259747ec3ec4d0a75bbad8880
BLAKE2b-256 a1542f2526225a7e032f1707f9bb9b41db17858f6d861df534381d23e03fd36e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.3-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4d2f17fa5310e3b9e186d572083faf7e6c0fff34bf1474d4e7d49d6593cd6912
MD5 a8c86663e7b0d711931eeb214437567f
BLAKE2b-256 c22f9a328b023ca14b054dde03e4f49e2bd51f66fc917f33874e340edb3f5b79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1347acd93357bbf993c1f78ae1a383bdfcb940ad5a6bb24c1463825782082a13
MD5 5ad3cf0a277f8addffa07ca64f3701c5
BLAKE2b-256 b05f316b583846d0abf2de5eddf44909706acdb9d1fafb178b4353f56eca97af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.3-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a642b464f3ef2eb473b23f20887f5e00d078349ceec4f6a59f8c1b251dc25acc
MD5 cad23770bf13619060ecbca48396f36f
BLAKE2b-256 e3c8ba501da28883e2e23eaa14b27c9cd376c300e3424a314eb2983d8b9fb94c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.3-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 38a406a335e42dab4591c76543c936f3857f805e348296626296f803a4936778
MD5 65406d9f213fe27efe6617465a32dc07
BLAKE2b-256 bef26f18de235752ae702cc049489dc5adea4da7f54b20711e472363976d6a4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 75ce31aba957439c6ef6cbf6104cb6f9172a0d9bfdc7989f1b6e44c3c674cf7c
MD5 b6e76c496977ad1ac6b2c71b1e6ae0e7
BLAKE2b-256 f466f327ca5d84ffe9bdc0d121073ea9eb4e595f4a62c15a0a34f266659eb6d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 28f359a751a12c3de979eb5b0341b7baccef5833c47a8d20f0ad5e0b730e9c17
MD5 2da8161c7123a5936316e393e8605269
BLAKE2b-256 ce19ab3c320f068fa84c315cc2cfbf71d0ea1ef4e1437af47ca7f63a5856d328

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-2.0.3-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 efbef0a1761d8a3394d034911c25106ce16c52877310645514f3585fa3017dba
MD5 0bd13bffea9288dc81e3724c4399341c
BLAKE2b-256 2bfdbab7e4c51a433931fcdc05c60ecdcdfd9e1ed84a8f4b593ba4165ddc0949

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