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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-0.0.1009.1-cp311-cp311-macosx_10_9_universal2.whl (399.9 kB view details)

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

marearts_anpr-0.0.1009.1-cp310-cp310-win_amd64.whl (189.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-0.0.1009.1-cp310-cp310-macosx_10_9_universal2.whl (399.8 kB view details)

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

marearts_anpr-0.0.1009.1-cp39-cp39-win_amd64.whl (213.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-0.0.1009.1-cp39-cp39-macosx_10_9_universal2.whl (402.8 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 818661424bed4bd9220e993dabe716c68f8620a9452e24bb142a85c84125b05d
MD5 53010d51d362585516b6168d10e9b012
BLAKE2b-256 eee69e743d1b082f1f4bf8a3d373d352bc78ac94262109317b1fb1209b7059e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4ba1e76e7b4f202acd92f1cffb67c0c6fc65a5e2dc8944f5880cd7a39b0ce831
MD5 583a11b9772b33e0224dc1b49477a983
BLAKE2b-256 34751fe2102206f3465c93cab4b965aa73596eb8e01989ea502f280420725c1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.1-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 66bd6120008d07bd47b04a19f5c6c6bdad3731ef720110d3accecd6eb35a1022
MD5 57a174d9e0bdb7e2014d90d2ddaddabb
BLAKE2b-256 8032f6106f9b5c1ea096b2bf9b5b7c14aad0313b2228689c8ea39e5804ee52b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4ec359edf40d491c85f2390d434bda815d509ee9f62bbd8528d132a80521c3ce
MD5 5f9cc8fa353278ddfeb5be048f72de9b
BLAKE2b-256 307b5bea9de2e24c421fca64cc33ccfeea224f1270df15fefeaa8bd5a32e6e41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0af7bdb3ffa7ad46440f0b78227527aea33cad60edea01b5bd0c7f2d54253d33
MD5 030e977953aaf804c50f1b00d7e360f0
BLAKE2b-256 f1ca3c7103203bd94152975893e36c2bb51813b5a249f22f6366fa5eb5cbd703

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 68e363beb628dc76ca328e89c0309974bff3fe03f844a1f6614305898bb72d0b
MD5 4924761df65ea6f9ce5f82d91852136a
BLAKE2b-256 099d737891025c0883a0c833a26bdb6c16006a0897e1ef6ece43cc6db0f8adaa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 912938a9b832ef0c0ef263325b104259763e9f1e6629cfd40915ad6a6964f859
MD5 eca9f03abf5bd99d7bc50f53cfb38a0b
BLAKE2b-256 3d502dff889f3ad7b09defdfa3c8f2ad9d89bc50f0030ec2a26f846cd93fd120

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fca84be4809b625c69bd826e788a10e9301444b1a76e8e87c1126659c12e3331
MD5 e40b5ee0e7bf850acc9dcc48e4da2683
BLAKE2b-256 29a9c3fa6a28760429e73bd4230da7d902ee7e4c2ac5ff8905c80ca4557b7123

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1009.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6eeac22f81a117dcaa16f9cedb69081fdc965ffc2c375d0ae583a3149209e285
MD5 a063ae906ffb1abce4f21cf50ac83f66
BLAKE2b-256 1c12e5afe5c4919aacade25452b6a1a98115d080322be1e909440eedf6e23025

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