I’m building a DeepStream Python application where the goal is to process video streams through a sequence of inference
PGIE: Detects vehicles.
SGIE1: Detects license plates from the vehicle bounding boxes.
SGIE2: Performs OCR on the detected license plate regions.
The first two stages (PGIE and SGIE1) are working as expected. SGIE1 correctly operates on the PGIE output and identifies license plates. The challenge is in the third stage: SGIE2 needs to run OCR on the outputs from SGIE1, but I’m running into limitations with how DeepStream handles SGIE-to-SGIE metadata propagation.
As far as I understand, SGIEs are designed to operate off PGIE metadata, and while the operate-on-gie-id field theoretically allows SGIE chaining, the framework doesn’t seem to support using the output of one SGIE as input for another in a straightforward way.
Appreciate any guidance or best practices for handling this kind of multi-stage inference workflow.
please refer to NV LPR recognition sample, which includes three models(detection->detection->classification). You can set operate-on-gie-id of sgie2 to the ID of sige1.
When adding SGIE2 to the pipeline, I get the following error:
Traceback (most recent call last):
File "/opt/nvidia/deepstream/deepstream-7.1/sources/deepstream_python_apps/apps/deepstream-yolo/deepstream_yolo.py", line 539, in <module>
main(stream_paths, pgie, car_config, plate_config, ocr_config, disable_probe)
File "/opt/nvidia/deepstream/deepstream-7.1/sources/deepstream_python_apps/apps/deepstream-yolo/deepstream_yolo.py", line 438, in main
pipeline.add(sgie2)
File "/usr/lib/python3/dist-packages/gi/overrides/Gst.py", line 73, in add
raise AddError(arg)
gi.overrides.Gst.AddError: <__gi__.GstNvInfer object at 0x73e3f8364700 (GstNvInfer at 0x5b8c775e6fc0)>
All three models are YOLO11 and have been successfully converted using the DeepStream-YOLO repository. The pipeline works fine with just PGIE + SGIE1, but fails when adding SGIE2.
I’ve verified that operate-on-gie-id=2 in SGIE2 config matches SGIE1’s gie-unique-id=2, and all model files exist and are accessible.
The Python DeepStream error messages are quite vague. Are there better ways to debug these issues?