Raspberry Hailo 8L ALPR

I’m a total beginner when it comes to NN and so I bought a Hailo 8L for my Raspberry Pi5. Now I hit a snag I wanted to run ALPR on my 8L and google led me to TAPPAS but it didn’t work because it is made for Hail 8. Is there a working example for my 8L?
Thank you

Hi @tady.the.fish,

Regarding ALPR support: Our current implementation in Tappas is optimized for Israeli license plates only ( and not optimized for rpi ). You have Three options:

  1. Wait for our upcoming release in the Raspberry Pi examples (Hailo · GitHub) which will have expanded support
  2. Start working on your custom OCR model now, and I can help you integrate it into our pipeline when you’re ready
  3. Check out this community project Bad Image Quality When Cropping Car Plate

Let me know which path you’d prefer to take, and I’ll be happy to provide more specific guidance!

Best regards,
Omria

I’m trying to retrain your hailo zoo lprnet but I have alot of problems. To me it seems that the python script that is used for traning (pictures of plates with coresponding names) only support numbered plates? Is this the case?

When can we expect the upcoming release?

Let me address your questions:

  1. Yes, the current OCR only detects numbers since it’s trained specifically for Israeli plates.(only numbers)
  2. The RPi examples and pipeline updates will be ready in 1-2 weeks, but I can help you with pipeline integration now if you need it.
  3. Regarding global license plate models - I’ll need to check with R&D and get back to you.

I can wait for the examples to be published. I think it would help alot for us hobby people that mostly buy the L version to have these examples. Are there any plans to expand the training scripts to handle letters? I would really (in the near future) like to try to train on EU plates. For starters it would be enought just to have the HEF files and working 8L + Rpi5 examples

@tady.the.fish
We published a guide to build a license plate recognition system using Hailo8 and Hailo8L devices: A Comprehensive Guide to Building a License Plate Recognition (LPR) Systems. Please check if you find it useful.

Thank you for this, but sadly I have to say it does not help. For a total noob like me this is eve more confusing. The code snippets are totaly different than the examples in the TAPPAS repo and there are no depencencies listed. I don’t know how to make this work. And also what is Degirum? This is new to me (not seen in any other priject).The TAPPAS repo has nice examples but they are all for the nirmal 8 version and 15. There are absolutley no examples for the L version ( except the raspberry pi 5 examples, but those don’t contain any ALPR examples). What I would like to see is the compiled HEF files for the ALPR. I tried compiling and training my own but the first snag that i have hit is the need for ubuntu 22. I use Arch so I wiped my disk and installed Ubuntu 22 only to find out that I need more than 16GB off ram ( i have 16gb and does not cut it) so I wiped my drive afain and reinstalled Arch. I have put ma Pi5+hailo-8L in my drawer in hopes that one days someone will share a working project that I can run and learn from there.
Thank you kindley for your work and I hope someone else will find this usefull

Hi @tady.the.fish
Thanks for your feedback. I will try to provide more context so that you can understand some background information. Since a lot of people were having trouble getting started with TAPPAS and GStreamer, we at DeGirum developed a python SDK that simplifies working with Hailo devices: Simplifying Edge AI Development with DeGirum PySDK and Hailo. Please let us know if we can provide any further help.

1 Like

Aaa ok I see now. Any specific OS requirements? Or specific python versions required?

@tady.the.fish
PySDK works on windows as well as linux. We have tested Raspberry Pi + Hailo combination extensively (HailoRT version 4.19). As for python version, PySDK supports 3.8-3.12. We recommend using the python version compatible with HailoRT.

Very nice. One more question ( maybe a stupid one). On your github page it is noted under Prerequisites…

Hailo Tools Installed: Ensure that Hailo's tools and SDK are properly installed and configured. 

What SDK is this? Hailos AI Software suite?

Hi @tady.the.fish
Yes, to be able to use Hailo devices, you need to have their tools installed.

I installed the SDK per instrucions with succes, now I’m trying to run this snippet

import degirum as dg         # import DeGirum PySDK package

# load mobilenet model from deGirum's public model zoo to run in the cloud
model = dg.load_model(
    model_name = "mobilenet_v2_ssd_coco--300x300_quant_n2x_cpu_1",
    inference_host_address = dg.CLOUD,
    zoo_url = "degirum/public",
    token = "<your cloud access token>",
    image_backend='pil'
)

# perform AI inference of an image specified by URL
result = model("https://raw.githubusercontent.com/DeGirum/PySDKExamples/main/images/TwoCats.jpg")

print(result)                # print numeric results
result.image_overlay.show()  # show graphical results

But I get an Authorization error. Can you explain to me how this works? Doesn’t this run on my raspberry? Do I need an onlin connection

HI @tady.the.fish
To run inference in the cloud, you need to have a token for our AI Hub. But to run locally, you do not need any token. We have usage example here with instructions to get you started on raspberrypi+hailo: Quick Start

It seems I judget too quickly this is very nice :slight_smile: thank you. I was able to run the TwoCats and Object tracking examples. To make them work locally I needed to modify the script

model = dg.load_model(
    model_name=model_name, 
    inference_host_address=inference_host_address,
    zoo_url=zoo_url
    #token=degirum_tools.get_token(), <---- Comment out his
)


Or I would get an error

Traceback (most recent call last):
  File "/home/pi/Hailo/test2.py", line 22, in <module>
    token=degirum_tools.get_token(),
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Hailo/degirum_env/lib/python3.11/site-packages/degirum_tools/environment.py", line 71, in get_token
    return get_var(var_Token, default)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/Hailo/degirum_env/lib/python3.11/site-packages/degirum_tools/environment.py", line 49, in get_var
    raise Exception(
Exception: Please define environment variable DEGIRUM_CLOUD_TOKEN in `.env` or `env.ini` file located in your CWD

Also dou you have an ALPR example for the 8L?

Hi @tady.the.fish
Glad to hear you got PySDK to work. Our ALPR example is for Hailo8l: A Comprehensive Guide to Building a License Plate Recognition (LPR) Systems

Thank you I was abke to get it working. Thank you again for this. If it wasn"t for this I would have shelved or sold my 8L.
Now to figure out how to feed a stream to ALPR :grin:

@tady.the.fish
Happy to hear that you got ALPR working. Modifying the code to work on a video stream is very easy. Please see our guide: A Comprehensive Guide to Building a Face Recognition System where we provide detailed instructions on such model pipelining and how to run them on video streams. Please let me know if you encounter any issues.

Thank you I will take a look. Thank you.
May I ask if it is possible to print the inference time in the ALPR example?
Maybe the inference time for plate detection and also the OCR
Thank you