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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-0.0.926.12-cp311-cp311-macosx_10_9_universal2.whl (399.3 kB view details)

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

marearts_anpr-0.0.926.12-cp310-cp310-win_amd64.whl (189.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-0.0.926.12-cp310-cp310-macosx_10_9_universal2.whl (399.2 kB view details)

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

marearts_anpr-0.0.926.12-cp39-cp39-win_amd64.whl (212.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-0.0.926.12-cp39-cp39-macosx_10_9_universal2.whl (402.1 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.926.12-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bc49ad6d69c75f73e0f22f06d0e3cda2eb8a24fb21102eb7254e915ea8c589c2
MD5 b95299f536ef5d8d18f4b1245406e3ef
BLAKE2b-256 78e200787306e46a0258278ed74e4319b67c404092fdb21baf17eab09e1ea608

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.926.12-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 63fda0ac5b4bee8d9a3e6cde38e4da0fbc9d0fbd6f42e03c93a6c75d4fe50f35
MD5 529f51f85e6c7ed37a65ce08a9995f69
BLAKE2b-256 0296b2873d59a444c5f881204595e3889df55bc98eb736acbaff4b2999016cb9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.926.12-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 404e4ac038fe1d1812a47a8002dfea6de0b3bfe49ce60f4a265a1f2e09bfb1b3
MD5 14ab2416525ca8d01b70e2f0b9cfb8c0
BLAKE2b-256 cb999a6234d908f3ba6ec32a3d9e375499172b40643171179343301524860583

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.926.12-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 65739fd01c069acd0ca76f391e984d4301902d38c48fc0661fa402380fd4a870
MD5 09ba5cfbf973726df4bdfba5f883c2a8
BLAKE2b-256 06e372ed5b8799a0dd5912d7a223ae7422fb3796e0d87a7688cf50c2def8e5ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.926.12-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 93b1e0e2e933b61f33477d8e85de7da1af4464860fe6f70f704614c5174c8342
MD5 8e7a42f75d79048f7fca3ed9eb346f1b
BLAKE2b-256 da7cd9c2b397864ef3c96374e487d7c0f0af3cb65fde7e9c2dca2eed153ccb57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.926.12-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d38325ca413dcb7211283d80555b1fd8967df22013e325d12c523fc4fac65594
MD5 b4c9118cdd6d5f1c0d4d05a41d796b27
BLAKE2b-256 f006913491fea967127dba9fc1e4bc88c16a3b1fd52b5b14ad0f0f678dbbba42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.926.12-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1886a1784593580572a34f221d392f0d259f65d29ca2e15d3658f34d6830f551
MD5 4467363be5ea7e37ab420c9c87ca2e2d
BLAKE2b-256 30c7f0c4605536a62d643f36cd48a980d96b331ce3437dd8dca4ce64b1ded338

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.926.12-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2bd01d3937a98f69a43948821fed7750b02a86ad0e32a38bc5442556d67de73e
MD5 746b666871b0e2f918a75829b75782f8
BLAKE2b-256 0a670245444c3689bdf4fe317e11ed703ef346e0b870e58903e39e564ac1f3da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.926.12-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c790e356b7795744aa3e0a6f78b04c9a216eea11e48f6bbe60e375cd97d2e081
MD5 b0bcc4af093beef1992a2740f2602d88
BLAKE2b-256 54c94faa963ab3442a0c9f20e9b56af6221c636d43094f09ca11f3b18d8f9d3c

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