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

Uploaded CPython 3.11 Windows x86-64

marearts_anpr-3.1.3-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-3.1.3-cp310-cp310-win_amd64.whl (190.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

marearts_anpr-3.1.3-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-3.1.3-cp39-cp39-win_amd64.whl (214.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

marearts_anpr-3.1.3-cp39-cp39-macosx_10_9_universal2.whl (404.6 kB view details)

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

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6441839b6b4824c167d045512a1917ca1ee4c1232b30c37eb47b08652a1cb6e0
MD5 a7206c84f19c6a320667161d69a1d7b1
BLAKE2b-256 dd4f000fada3e17eff23c2da6855b2e68e0a8a96eac3cc061cd56b4c6d84892f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.3-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 89272c371d00952492b5c3ee5478f4e62a4341b708748269a59ab2e4c1699229
MD5 abe13cfd883837e2c368edf5aeb87ec9
BLAKE2b-256 ddf6b124eee5a21a4f31192c994b056cacf82b1234bf907784383763b3eeef14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.3-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 31de84fc294c5695a9b7b29a7542087126f2cdc3576c2c09ecc38d2537980738
MD5 ce8fb6046a044df89cd39eff3ab49414
BLAKE2b-256 1c8a557221b350b80d9fb5131a3d4c9e9d66bc542da50b11ce44d3342e3ba0c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b7a266649073e76a081fe89223e4155e79123135db9b7aec608b36d1e7f7ef0e
MD5 bd939659fca348cca8c422a22a49aa74
BLAKE2b-256 fda189f5bd697d2ddc47df9d6cb492484933dae9b971e43538687c32e64b6e0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.3-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a9b28405d653073a72885e78d080b27903ad0d722ce7e3549f967f40ab11881e
MD5 4fbce8baefe70f79b888c33e288f04e7
BLAKE2b-256 6f61694c7afa844a197273040e62b008c4655d28256c85084fa24686ea279b66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.3-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 8090967465b4f5171b35525ec8f21541543d97ae8aede93e8c99aa9db469e9b7
MD5 1b45bbc59612c8784a701d9ec9c8f34f
BLAKE2b-256 e639a3b1ed720dff4407bf675fee4c2ee70fc482c6714e4ef7cc30054610c58a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5ffdf8b466f69808e4ca77c81a7583169e54c1073962a34b7596944940bea856
MD5 a001dc481b29595bc817aefacaa5623d
BLAKE2b-256 a17c6841e3a5ce3d2e03faee0ac7ef50b9d9980a08026935eafd8aeaf515a99f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 997ecd3733d9ef9975236effa51bdb43df6466f97b9dffd4327703c36cef6e25
MD5 7f6e6d057472f4f32c4a374ae059e55c
BLAKE2b-256 ac3f7fc2a476fa3b7fcd860691c63bff6596be265ea7be57f03cff1c7070a92e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for marearts_anpr-3.1.3-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2062ce19596f58811b616f9cba9c2a1b59111490f7c31dbdb86e81ec64544504
MD5 3ab8a46ab51b41b61d5401b93e7452e3
BLAKE2b-256 c693a5c70ee863ec46c8eb80b23c6fe4e9e1a08639a2ed33aaabea5e9962819a

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