import os
from glob import glob

from _paths import nomeroff_net_dir
from nomeroff_net import pipeline
from nomeroff_net.tools import unzip

if __name__ == '__main__':
    multiline_number_plate_detection_and_reading = pipeline(
        "multiline_number_plate_detection_and_reading", image_loader="opencv")

    result = multiline_number_plate_detection_and_reading(
        glob(
            os.path.join(nomeroff_net_dir,
                         './data/examples/multiline_images/*')))

    (images, images_bboxs, images_points, images_zones, region_ids,
     region_names, count_lines, confidences, texts) = unzip(result)

    print(texts)
示例#2
0
"""
python3 examples/py/inference/get_started-demo2.py
"""
import os
from _paths import nomeroff_net_dir
from nomeroff_net import pipeline
from nomeroff_net.tools import unzip

if __name__ == '__main__':
    number_plate_detection_and_reading = pipeline("number_plate_detection_and_reading_v2",
                                                  image_loader="opencv")

    (images, images_bboxs,
     images_points, images_zones, region_ids,
     region_names, count_lines,
     confidences, texts) = number_plate_detection_and_reading([
        os.path.join(nomeroff_net_dir, './data/examples/oneline_images/example1.jpeg'),
    ])

    # (['AC4921CB'], ['RP70012', 'JJF509'])
    print(texts)
示例#3
0
import warnings
import os
from glob import glob

from _paths import nomeroff_net_dir
from nomeroff_net import pipeline

warnings.filterwarnings("ignore")
os.environ["CUDA_VISIBLE_DEVICES"] = "0"

if __name__ == '__main__':
    number_plate_detection_and_reading = pipeline(
        "number_plate_detection_and_reading_runtime",
        image_loader="opencv"  # Try 'turbo' for faster performance.
    )

    num_run = 1
    batch_size = 1
    num_workers = 1
    images = glob(
        os.path.join(nomeroff_net_dir,
                     "./data/examples/benchmark_oneline_np_images/1.jpeg"))

    number_plate_detection_and_reading.clear_stat()

    for i in range(num_run):
        print(f"pass {i}")
        outputs = number_plate_detection_and_reading(images,
                                                     batch_size=batch_size,
                                                     num_workers=num_workers)