Deepstream 5.0 Python app with 3rd party OCR

Good day,

I’m working on a Deepstream 5.0 python application which would count vehicle traffic flow and OCR license plates in realtime on Xavier device.
And looking for guidance and best practices in feature implementation.

As I understand on featuers:

  1. Vehicle detection can be done using TrafficCamNet
  2. Tracking using Deepstream built-in trackers
  3. License plate detection using ending from back-to-back detector from Deepstream 4.0
  4. On OCR I’m choosing between Teseract and OpenALPR

So my question is - what are the best/fastest-in-implementation way to implement feature #4 in Python application?
Options I know are:

  1. Import tesseract-ocr in Python code and process license plates cutouts in separate function
  2. Scrap Tesseract/OpenALPR for pretained models and use them as TensorRT engine in a Deepstream pipeline
  3. Make a gstreamer module (this is more like C++ coding)

I’d be glad to hear any feedback. Thanks!

Hi! Both Tesaract OCR and OpenALPR have Python bindings:

You can use them from a probe function in your Python app. The sample code on those sites load images from file which would be inefficient. If those bindings can directly work with numpy or cv2.image, then it would be much better. Still, it’s possible to save images to file from probe function and then reload them.

Please refer to the image data access app for retrieving the images and processing/saving them with OpenCV: