How to change the colors of text-background and bounding-box border?

Hi,
If I want to config the colors of text-background and bounding-box border same as original yolo(darknet),
how to modify the code of deepstream-yolo-app.cpp?

Does both attributes should be setup like bellowing codes in deepstream-yolo-app.cpp?

215   /* we set the osd properties here */
216   g_object_set (G_OBJECT (nvosd), "font-size", 15, NULL);

If I want to car, trunk, person and bicycle have their own color, how to modify the code?

Please have a look at the “osd_sink_pad_buffer_probe(…)” function in test1-app from the Deepstream SDK. The NvDsObjectParams has a txt_params struct which holds the background text color and bounding box color information. You can make similar changes in the “osd_sink_pad_buffer_probe(…)” of deepstream-yolo-app.cpp to set the desired colors.

@NvCJR

Do you mean I should create a function like gst_pad_add_probe (osd_sink_pad, GST_PAD_PROBE_TYPE_BUFFER,
osd_sink_pad_buffer_probe, NULL, NULL) in deepstream_test1_app.c, the osd_sink_pad_buffer_probe() will be launched and config txt_params, so that background text color and bounding box color will be changed?

If it is, the g_object_set() for color setting will be not required, am I right?

The function is already present in the app. You only need to change txt_params corresponding to NvDsObjectParams over here

https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/blob/master/yolo/apps/deepstream-yolo/deepstream-yolo-app.cpp#L82

@NvCJR,

Thanks a lot, when I fill up txt_params and rect_params the background text color and bounding box color have been changed.

Now, I have another questions:

  1. How to change the display mode of deepstream-yolo-app? I hope it can show on a window not full screen.
  2. How to modify the title style of bounding box? can it be changed to bold style?

Hi,

  1. The app uses an egl sink which can be resized using a mouse to the desired size.
  2. Do you mean increase the thickness of the bounding box size ? if yes, you can increase it here –
    https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/blob/master/yolo/plugins/gst-yoloplugin-tesla/gstyoloplugin.cpp#L675

@NvCJR

  1. No, I cannot resize using a mouse, it occupied full screen and all hot key except ctl+c. But this problem have been solved.
  2. No, I want to change the title text(eg. person, car…)to bold style.
  1. No currently that is not supported but you can vary the font size through nvosd’s font-size plugin property if that helps your use-case.