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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-0.0.1019.5-cp311-cp311-macosx_10_9_universal2.whl (401.7 kB view details)

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

marearts_anpr-0.0.1019.5-cp310-cp310-win_amd64.whl (190.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-0.0.1019.5-cp310-cp310-macosx_10_9_universal2.whl (401.7 kB view details)

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

marearts_anpr-0.0.1019.5-cp39-cp39-win_amd64.whl (214.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-0.0.1019.5-cp39-cp39-macosx_10_9_universal2.whl (404.7 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.5-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2f0d8680a66272efd598e15eefc34e719e9388644364bcf2f394c3685191cb6f
MD5 2ff3929cc7404af744b186e6531cf84a
BLAKE2b-256 b47ba17547128e323489a157bff60248c61b4580aabcbf599b5502b926f085b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.5-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e7195529c15d53737c6a7ea91051d27a4ec738686374a8b173125b9bfb795dc
MD5 2df9d5aadeaaf235ee0a8848feea700f
BLAKE2b-256 638d60987bc555bf66bd4b2b2a7f074a5910d9a887df353387b37049565b082c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.5-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2189e5fb3b0d37dbb5033e89efc8a88f80d0bc443a3a5a50789cedbeee8c620d
MD5 ac78c20a34757c0c08c5ed543e11f250
BLAKE2b-256 9254ce3535eaef1f8d4d09ee5017e2e6f5d959ac94986ab03352838fb76b6a83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 540680b830c20e0431105ce482a1e7e5e687736d2ba20080add9e30a36d08850
MD5 8f4ac27e6fc5915f63129c70116dc538
BLAKE2b-256 bdd79ac1649cf1bebd8a078bc4370d56e4f8eb01fde691c7698441119a66c2cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.5-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 529509ebfbdfd7597e5aadc1e8e6e1e820172bb4c25f5ef08f5d07d8e965bed2
MD5 1d707b5ca1bbfdaf9c08a956147bf435
BLAKE2b-256 d9645c32ca917d2c475ac47deaa78fecf8a9d2ae5161784662c9999afd2aadc0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.5-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b4ad6002b96ea7e9f923d4887ad132cf82907e787a3a7d13dea443329794f939
MD5 65f3d3e8301a3990de0c3b83487e38fa
BLAKE2b-256 16a63335ca72ef808a2cd4380e97c85b0671988ae00d0222c995b2f11937b21c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d25325941c34fcdd41b15a0c3c5de6ff14f761a8311ba7394f25726deef86d1d
MD5 d3be062d0a2391df8f3fd5a70eb4c560
BLAKE2b-256 b00a53fcfdaa5f97f73e6d25e84df346af8922b2c49b52194383cf891d305001

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.5-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 873df7d48576702a91b1c2a54649a5cf650a97848fd57e3e3db8718773e6bc7b
MD5 580741bb133c5ff6530dbf401ab8673a
BLAKE2b-256 19d6c5d9c13420b4cb0b9627f7ea3d828b437a32cc9a5267176187cb0709f5db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-0.0.1019.5-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1de09e90bd197732c6c41c79976fc607984528a514e7871df18bcedc3425eac4
MD5 944049323a0703e514387a2d21a6eefe
BLAKE2b-256 8765935ab82922a111204273656c67a984ed336277e6aef347f9d72b829e88b7

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