Hi~
I use this project to run yolov3
https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/tree/master/yolo/apps/deepstream-yolo
And I run it successfully,but I want to get some specific detected bounding box info such as coordinates and label and confidence.I use such code in deepstream-yolo-app.cpp
for (rect_index = 0; rect_index < num_rects; rect_index++) {
obj_meta = (NvDsObjectParams *) & frame_meta->obj_params[rect_index];
if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
"car"))
{
g_print("CAR topX=%d, topY=%d, width=%d, height=%d, score=%.2f\n",
obj_meta->rect_params.left, obj_meta->rect_params.top,
(obj_meta->rect_params.width),
(obj_meta->rect_params.height),
obj_meta->attr_info[YOLO_UNIQUE_ID].attrs->attr_prob);
car_count++;
}
else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
"person"))
{
g_print("PERSON topX=%d, topY=%d, width=%d, height=%d, score=%.2f\n",
obj_meta->rect_params.left, obj_meta->rect_params.top,
(obj_meta->rect_params.width),
(obj_meta->rect_params.height),
obj_meta->attr_info[YOLO_UNIQUE_ID].attrs->attr_prob);
person_count++;
}
else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
"bicycle"))
{
g_print("BICYCLE topX=%d, topY=%d, width=%d, height=%d, score=%.2f\n",
obj_meta->rect_params.left, obj_meta->rect_params.top,
(obj_meta->rect_params.width),
(obj_meta->rect_params.height),
obj_meta->attr_info[YOLO_UNIQUE_ID].attrs->attr_prob);
bicycle_count++;
}
else if (!g_strcmp0 (obj_meta->attr_info[YOLO_UNIQUE_ID].attr_label,
"truck"))
{
g_print("TRUCK topX=%d, topY=%d, width=%d, height=%d, score=%.2f\n",
obj_meta->rect_params.left, obj_meta->rect_params.top,
(obj_meta->rect_params.width),
(obj_meta->rect_params.height),
obj_meta->attr_info[YOLO_UNIQUE_ID].attrs->attr_prob);
truck_count++;
}
}
But I can get the data correctly.I set
--print_prediction_info=true
so the correct data could print into console.
I get these output:
Frame Number = 246 Number of objects = 4 Car Count = 2 Person Count = 1 Bicycle Count = 0 Truck Count = 0
label:0(person) confidence:0.907101 xmin:597.744 ymin:37.4152 xmax:619.409 ymax:98.2252
label:2(car) confidence:0.995119 xmin:211.866 ymin:81.8601 xmax:502.891 ymax:286.64
label:2(car) confidence:0.977487 xmin:430.033 ymin:-3.67276 xmax:522.505 ymax:83.8293
label:58(pottedplant) confidence:0.801424 xmin:524.853 ymin:8.81585 xmax:593.72 ymax:56.3274
EPRSON topX=2388, topY=148, width=84, height=240, score=0.00
CAR topX=844, topY=324, width=1164, height=816, score=0.00
CAR topX=1720, topY=-12, width=368, height=348, score=0.00
Frame Number = 247 Number of objects = 4 Car Count = 2 Person Count = 1 Bicycle Count = 0 Truck Count = 0
label:0(person) confidence:0.906911 xmin:597.744 ymin:37.4155 xmax:619.409 ymax:98.2296
label:2(car) confidence:0.995171 xmin:211.976 ymin:81.8419 xmax:502.756 ymax:286.646
label:2(car) confidence:0.977507 xmin:430.045 ymin:-3.66733 xmax:522.515 ymax:83.8464
label:58(pottedplant) confidence:0.802497 xmin:524.839 ymin:8.81618 xmax:593.726 ymax:56.2834
EPRSON topX=2388, topY=148, width=84, height=240, score=0.00
CAR topX=844, topY=324, width=1160, height=816, score=0.00
CAR topX=1720, topY=-12, width=368, height=348, score=0.00
It is clear that I get the wrong information.How can I parse the detected bounding box information?And I can not see any detailed codes which write the specific method that defined in the <DS_SDK_ROOT>/samples/include folder?