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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-3.1.1-cp311-cp311-macosx_10_9_universal2.whl (399.6 kB view details)

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

marearts_anpr-3.1.1-cp310-cp310-win_amd64.whl (189.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-3.1.1-cp310-cp310-macosx_10_9_universal2.whl (399.5 kB view details)

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

marearts_anpr-3.1.1-cp39-cp39-win_amd64.whl (213.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-3.1.1-cp39-cp39-macosx_10_9_universal2.whl (402.5 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a5959b1706181086fada074744f761b52f3a721a44e06a2204cfa118d11794f2
MD5 ac79beca7a6f05ef8233f4a1da000533
BLAKE2b-256 fbd28c7a45cb19936e65fc39d3a57bcfa58e83fc520f218e029241ee41361223

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90467e9e86eecb96f336c84c2ffcad0adb3e5a97a1d331596585971d78ae304a
MD5 edd8f14c324938a277e96b3cb7e882a0
BLAKE2b-256 ee79de1289fff4ac61d01e15735f05c5ea46ae3891b467a3f3abb510b22716a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 57f9af632141d7042fd93642b1487e59f32d3f44b759932be8bdcacb3b41c2d9
MD5 b8d9accfd6a36d8ff354e5fcc5b60038
BLAKE2b-256 94178638ae5df1b018285acf3ea0ab91933e121dfd4eea318312a68227bcc6fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f47e22df86d1d201cd85bfbb41e23f5de81a7a28d41b4993b4ae3baac3572caa
MD5 96bc63df3dc6543f1d079cf8db3d73b3
BLAKE2b-256 64057b4856d3a7e3353c79df5a51c5aa8eb6c9c0871baf2f6edca6df96ea1789

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5e54cae125621dc986f23f2ae632d30d93febee1e3fcb94039715b90482bfe17
MD5 c59a48553a6f2e3a7ead34199c32756b
BLAKE2b-256 9fda6016ead87082bcc0163b74104fbb2148bef7c7b70ca62b6873b603e6892a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a4b24f9fd90cb2a3cfd9d0c957a2b759db893fbb6afe72f591bf74241d8e604b
MD5 5e89cbcc7edfa4bc5746321a48ae0b0a
BLAKE2b-256 ec8d55b034c0f35ebbf533b7372d2241c6b474c48c9e4f4f5fc46197f442d85e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c502e603fa3fb928a255d56969c43c42835ee8c963ec5e1e097410b5b5b8aa00
MD5 ef67f535df14b43ac87d12f5347636c9
BLAKE2b-256 9678b5b8c5ac9438bf30a120db423cef0ff3eac62932c04b7150e1994b96d342

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 de13ae7a649e3b0d4ff2f92deb7f7e4e526f0113f4e5362e998c5554840b783c
MD5 e5046a21f21dd79895cdc4faba82dd37
BLAKE2b-256 b92825c3cf30cbd49aab7c93e7aaaba8af3c4f6eb0b04ead50f58a71cee58be5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7c109976da1c16889e7f05d27f0f59991e092cd1b888aea3338311807795bb49
MD5 a90f2046e29d5228059a606d49427022
BLAKE2b-256 0927afa675059fa1aa10cb88cd9a9bf89515727a7fef56e7b976d3abef6878bf

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