How to split and crop a box in a landmark_pad_probe nad infer with another element?

Please provide the following information when requesting support.

• Hardware (RTX2070)
• Network Type (Yolo_v4_tiny)
• TLT Version (Tao 3.21.11)

Hi. I am using fpenet–>facelandmark model example of deepstream 6.2. Through some landmarks
in GstPadProbeReturn function I define a rectangle like:
disp_meta->rect_params[disp_meta->num_rects].left ==xx top width and height.
and
disp_meta->rect_params[disp_meta->num_rects+1].left etc

I want now to split first into two pipelines that each infer on this squares as seperate roi. How can I split?

Should I then crop? How can I define a src according to this rect_params? Can I retrieve rect_params from GstPadProbeReturn for crop element ?
which element is best with deepstream to crop? Can I have two seperate sinks as display in the end?

Hi,
This looks more related to Deepstream. We are moving this post to the Deepstream forum to get better help.
Thank you.

You can try to use a tee plugin as the split element in your picture. Then use the nvvideoconvert plugin as the crop element.

Could you please

Thank you indeed. tee seprates the pipeline easily. Can you please also indicate how can I crop dynamically using the data in a GstPadProbeReturn (disp_meta->rect_params[disp_meta->num_rects]) . Should I create a new appsrc ? Can I just use crop with rect_params with nvvideoconvert?

You can try the mothod below:
https://forums.developer.nvidia.com/t/dynamically-adjusting-crop-to-input-resolution/246828/4

Thanks. I receive freeze error when using the method you mentioned. "g_object_set(G_OBJECT(nvvidconv_crop), “src-crop”, scr_crop.c_str(), NULL); How can I free the memoryfrom scr_crop-c_str in pad probe function? Should I not crop with a pad?
g_free does not work.

What do you mean I receive freeze error when using the method you mentioned?
About how to free the string, you can refer to the link below:
https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/blob/master/deepstream-bodypose-3d/sources/deepstream_pose_estimation_app.cpp#L1861

The pipeline does not work. It freezes, or gives core dump error.

I suppose I can add data to pad with
gst_pad_probe_function :

g_object_set (G_OBJECT (nvvideoconvert), “src-crop”, x, y, width, height, NULL);

but I cannot retrieve data from Pad to nvvideocenvert with:

nvvideoconvert = makeElementAndLink(“nvvideoconvert”, NULL, bin, element);
GstPad *pad = gst_element_get_static_pad (nvvideoconvert, “src”);
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_BUFFER, gst_pad_probe_function , nvvideoconvert, NULL);

i can crop though with

g_object_set(G_OBJECT(nvvideoconvert), “src-crop” , “300:100:100:200”, NULL);

as an example, but cannot change 300:100:100:200 to values, that are written dynamically in gst_pad_probe function

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

You can refer to the link I attached before:

  gchar *string1 = NULL;
  asprintf (&string1, "%d:%d:%d:%d", _pad_dim, _pad_dim, _image_width, _image_height);

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.