How to send detections through Kafka

• Hardware Platform (Jetson / GPU)
Jetson Orin
• DeepStream Version
6.1.1
• JetPack Version (valid for Jetson only)
5.0.2
• TensorRT Version
8.4.1-1+cuda11.4

I need to send cropped detections from my python Deesptream app through Kafka. I read in the documentation that:

To handle custom object types, you must modify the payload generator library
nvmsgconv.cpp. See deepstream-test4 for details about adding custom objects as
NVDS_EVENT_MSG_META user metadata with buffers for generating a custom payload to send
to back end.

from: Gst-nvmsgconv — DeepStream 6.1.1 Release documentation
However, deepstream-test4 only shows the implementation of existing objects NVDS_OBJECT_TYPE_VEHICLE and NVDS_OBJECT_TYPE_PERSON, and the documentation just gives a brief explanation of how to achieve this. Also, I don’t underestand how modify nvmsgconv.cpp to achieve this.

How can I send the detections over Kafka? What are the exact steps to follow?

you only need to modify generate_event_msg_meta related code in osd_sink_pad_buffer_probe of test4\deepstream_test_4.py.

1 Like

Thanks for the response, I already modified it but if I need to pass the object data usingmeta.extMsg = obj I need to create an object such
obj = pyds.NvDsVehicleObject.cast(data)
How do I create a custom object?

  1. about " need to send cropped detections", do you want to modify the with/height of detection object.
  2. about “I don’t underestand how modify nvmsgconv.cpp to achieve this.”, plugin nvmsgconv will call libnvds_msgconv.so, both of them are opensoruce, you can add logs to debug, the path is: opt\nvidia\deepstream\deepstream-6.1.1\sources\libs\nvmsgconv\nvmsgconv.cpp
  3. about “How can I send the detections over Kafka? What are the exact steps to follow?” you can run deepstream-test4 to see how the meta is send to kafka server, especially, please refer to the plugin introduction and the application readme file.
1 Like