DeepStream-Yolo
DeepStream-Yolo copied to clipboard
post process for bounding box coordinates in deepstream_app_config.txt
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.
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.
https://github.com/marcoslucianops/DeepStream-Yolo#extract-metadata
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.
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.
in the folder: DeepStream-Yolo/ nvdsinfer_custom_impl_Yolo/ nvdsparsebbox_Yolo.cpp