DeepStream-Yolo icon indicating copy to clipboard operation
DeepStream-Yolo copied to clipboard

post process for bounding box coordinates in deepstream_app_config.txt

Open k-khosravi opened this issue 1 year ago • 5 comments

Hello! how can i use the bounding boxes for real-time post processing in Deepstream pipeline? Actually, I want to use the bounding box coordinates to calculate the distance of the object to camera in real-time and I don't know in which header with which attribute i can do that because when running the Deepstream with config files i have only headers and their attribute.

k-khosravi avatar Sep 04 '23 12:09 k-khosravi

Step 1: You can print that by adding the following lines to all_bbox_generated function in deepstream_app_main.c:

        float left = (float)obj->rect_params.left;
        float top = (float)obj->rect_params.top;
        float width = (float)obj->rect_params.width;
        float height = (float)obj->rect_params.height;

        g_print("Object ID: %d\n", obj->object_id);
        g_print("Class ID: %d\n", obj->class_id);
        g_print("Bounding Box (Left, Top, Width, Height): %.2f, %.2f, %.2f, %.2f\n", left, top, width, height);

Step 2: Compile the folder using: sudo CUDA_VER=10.2 make -C deepstream-app

Step 3: Copy the generated file deepstream-app to the bin folder inside.

emad555 avatar Sep 05 '23 05:09 emad555

https://github.com/marcoslucianops/DeepStream-Yolo#extract-metadata

marcoslucianops avatar Sep 05 '23 12:09 marcoslucianops

https://github.com/marcoslucianops/DeepStream-Yolo#extract-metadata

This would be the right way to do it. Adding a probe or playing around with NvDsObjectMeta element. My code above is a simple example to print out the metadata on the terminal, but it could be implemented in a different way.

emad555 avatar Sep 05 '23 15:09 emad555

Step 1: You can print that by adding the following lines to all_bbox_generated function in deepstream_app_main.c:

        float left = (float)obj->rect_params.left;
        float top = (float)obj->rect_params.top;
        float width = (float)obj->rect_params.width;
        float height = (float)obj->rect_params.height;

        g_print("Object ID: %d\n", obj->object_id);
        g_print("Class ID: %d\n", obj->class_id);
        g_print("Bounding Box (Left, Top, Width, Height): %.2f, %.2f, %.2f, %.2f\n", left, top, width, height);

Step 2: Compile the folder using: sudo CUDA_VER=10.2 make -C deepstream-app

Step 3: Copy the generated file deepstream-app to the bin folder inside.

@k-khosravi if this resolved the issue, please close it over there.

emad555 avatar Sep 07 '23 04:09 emad555

in the folder: DeepStream-Yolo/ nvdsinfer_custom_impl_Yolo/ nvdsparsebbox_Yolo.cpp

Strinkin avatar Mar 14 '24 22:03 Strinkin