Get detected bounding box infomations from deepstream-yolo-app

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?

Hi,

Why do you think the information is wrong ?

Hi
For example,I got this print:

Frame Number = 246 Number of objects = 4 Car Count = 2 Person Count = 1 Bicycle Count = 0 Truck Count = 0 
 [u]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[/u]
[b]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[/b]

I set --print_prediction_info=true in yolov3.txt,so I got the underlined prints.
And I use such code:

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++;
           }
        }

I got the Bold prints above.It’s obvious that they didn’t match.So I was really confused about this.If the way I used in code to parse the bounding boxes information was wrong I cannot write these result into database.

Hi
For example,I got this print:

Frame Number = 246 Number of objects = 4 Car Count = 2 Person Count = 1 Bicycle Count = 0 Truck Count = 0 
 [u]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[/u]
[b]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[/b]

I set --print_prediction_info=true in yolov3.txt,so I got the underlined prints.
And I use such code:

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++;
           }
        }

I got the Bold prints above.It’s obvious that they didn’t match(like the left corner coordinate597 << 2388,37 << 148).So I was really confused about this.If the way I used in code to parse the bounding boxes information was wrong I cannot write these result into database.

This is part of my print information,Hope you can help me fix,thanks a lot

Frame Number = 70934 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.96711 xmin:427.658 ymin:-3.22853 xmax:525.862 ymax:82.5863
 label:2(car) confidence:0.825994 xmin:201.362 ymin:75.0485 xmax:496.506 ymax:286.549
 label:58(pottedplant) confidence:0.830372 xmin:525.477 ymin:8.506 xmax:593.749 ymax:58.7065
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=356
Frame Number = 70935 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.967524 xmin:427.667 ymin:-3.22855 xmax:525.825 ymax:82.5739
 label:2(car) confidence:0.826864 xmin:201.373 ymin:75.0277 xmax:496.503 ymax:286.564
 label:58(pottedplant) confidence:0.827533 xmin:525.502 ymin:8.54667 xmax:593.758 ymax:58.7414
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=356
Frame Number = 70936 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.967558 xmin:427.673 ymin:-3.22756 xmax:525.82 ymax:82.5767
 label:2(car) confidence:0.828275 xmin:201.402 ymin:75.0489 xmax:496.532 ymax:286.559
 label:58(pottedplant) confidence:0.82754 xmin:525.498 ymin:8.54553 xmax:593.759 ymax:58.7397
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=356
Frame Number = 70937 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.967579 xmin:427.676 ymin:-3.22441 xmax:525.818 ymax:82.5745
 label:2(car) confidence:0.829223 xmin:201.392 ymin:75.09 xmax:496.535 ymax:286.543
 label:58(pottedplant) confidence:0.827533 xmin:525.497 ymin:8.54563 xmax:593.758 ymax:58.7394
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=356
Frame Number = 70938 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.967692 xmin:427.682 ymin:-3.22499 xmax:525.771 ymax:82.5533
 label:2(car) confidence:0.826011 xmin:201.428 ymin:75.1179 xmax:496.553 ymax:286.505
 label:58(pottedplant) confidence:0.827218 xmin:525.469 ymin:8.56412 xmax:593.75 ymax:58.6926
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=356
Frame Number = 70939 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.96772 xmin:427.685 ymin:-3.22243 xmax:525.76 ymax:82.5524
 label:2(car) confidence:0.826422 xmin:201.443 ymin:75.1135 xmax:496.545 ymax:286.505
 label:58(pottedplant) confidence:0.827596 xmin:525.475 ymin:8.56206 xmax:593.751 ymax:58.6838
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=356
Frame Number = 70940 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.966848 xmin:427.629 ymin:-3.2225 xmax:525.836 ymax:82.5744
 label:2(car) confidence:0.825751 xmin:201.432 ymin:75.3198 xmax:496.632 ymax:286.295
 label:58(pottedplant) confidence:0.827723 xmin:525.478 ymin:8.56573 xmax:593.75 ymax:58.685
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=355
Frame Number = 70941 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.966848 xmin:427.629 ymin:-3.2225 xmax:525.836 ymax:82.5744
 label:2(car) confidence:0.825751 xmin:201.432 ymin:75.3198 xmax:496.632 ymax:286.295
 label:58(pottedplant) confidence:0.827723 xmin:525.478 ymin:8.56573 xmax:593.75 ymax:58.685
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=355
Frame Number = 70942 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.96564 xmin:427.582 ymin:-3.19865 xmax:525.941 ymax:82.5579
 label:2(car) confidence:0.827437 xmin:201.496 ymin:75.3168 xmax:496.629 ymax:286.283
 label:58(pottedplant) confidence:0.834801 xmin:525.441 ymin:8.53871 xmax:593.717 ymax:58.6122
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=355
Frame Number = 70943 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965677 xmin:427.586 ymin:-3.19511 xmax:525.938 ymax:82.5567
 label:2(car) confidence:0.829252 xmin:201.456 ymin:75.3187 xmax:496.667 ymax:286.287
 label:58(pottedplant) confidence:0.834816 xmin:525.439 ymin:8.53822 xmax:593.717 ymax:58.6111
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=355
Frame Number = 70944 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965686 xmin:427.587 ymin:-3.19501 xmax:525.937 ymax:82.5537
 label:2(car) confidence:0.829795 xmin:201.415 ymin:75.3399 xmax:496.647 ymax:286.29
 label:58(pottedplant) confidence:0.834797 xmin:525.438 ymin:8.53791 xmax:593.718 ymax:58.6103
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=355
Frame Number = 70945 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.96569 xmin:427.588 ymin:-3.19329 xmax:525.937 ymax:82.554
 label:2(car) confidence:0.829571 xmin:201.421 ymin:75.3398 xmax:496.656 ymax:286.29
 label:58(pottedplant) confidence:0.834819 xmin:525.437 ymin:8.53769 xmax:593.718 ymax:58.6097
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=619 bottom=355
Frame Number = 70946 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965686 xmin:427.572 ymin:-3.20141 xmax:525.943 ymax:82.5513
 label:2(car) confidence:0.825061 xmin:201.672 ymin:75.1478 xmax:496.36 ymax:286.284
 label:58(pottedplant) confidence:0.834279 xmin:525.434 ymin:8.53538 xmax:593.718 ymax:58.5996
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70947 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965687 xmin:427.574 ymin:-3.20178 xmax:525.941 ymax:82.5516
 label:2(car) confidence:0.824073 xmin:201.701 ymin:75.0812 xmax:496.337 ymax:286.29
 label:58(pottedplant) confidence:0.834286 xmin:525.434 ymin:8.53538 xmax:593.718 ymax:58.5996
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70948 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965653 xmin:427.571 ymin:-3.20602 xmax:525.943 ymax:82.556
 label:2(car) confidence:0.824284 xmin:201.705 ymin:75.077 xmax:496.332 ymax:286.281
 label:58(pottedplant) confidence:0.834313 xmin:525.435 ymin:8.53571 xmax:593.718 ymax:58.6007
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70949 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965613 xmin:427.565 ymin:-3.20549 xmax:525.948 ymax:82.5512
 label:2(car) confidence:0.823825 xmin:201.699 ymin:75.0792 xmax:496.34 ymax:286.278
 label:58(pottedplant) confidence:0.83434 xmin:525.438 ymin:8.5364 xmax:593.717 ymax:58.6013
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70950 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965417 xmin:427.566 ymin:-3.20355 xmax:525.95 ymax:82.5301
 label:2(car) confidence:0.82263 xmin:201.762 ymin:75.0791 xmax:496.36 ymax:286.294
 label:58(pottedplant) confidence:0.832709 xmin:525.484 ymin:8.55022 xmax:593.676 ymax:58.594
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70951 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965417 xmin:427.566 ymin:-3.20354 xmax:525.95 ymax:82.5301
 label:2(car) confidence:0.822674 xmin:201.765 ymin:75.0778 xmax:496.357 ymax:286.297
 label:58(pottedplant) confidence:0.832709 xmin:525.484 ymin:8.55022 xmax:593.676 ymax:58.594
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70952 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965417 xmin:427.566 ymin:-3.20354 xmax:525.95 ymax:82.5301
 label:2(car) confidence:0.82249 xmin:201.764 ymin:75.0793 xmax:496.358 ymax:286.295
 label:58(pottedplant) confidence:0.832709 xmin:525.484 ymin:8.55022 xmax:593.676 ymax:58.594
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70953 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965417 xmin:427.566 ymin:-3.20355 xmax:525.95 ymax:82.5301
 label:2(car) confidence:0.822952 xmin:201.769 ymin:75.0881 xmax:496.36 ymax:286.29
 label:58(pottedplant) confidence:0.832709 xmin:525.484 ymin:8.55022 xmax:593.676 ymax:58.594
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70954 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965751 xmin:427.574 ymin:-3.20723 xmax:525.929 ymax:82.5422
 label:2(car) confidence:0.823964 xmin:201.745 ymin:75.04 xmax:496.387 ymax:286.37
 label:58(pottedplant) confidence:0.832504 xmin:525.483 ymin:8.54854 xmax:593.675 ymax:58.5933
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70955 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965764 xmin:427.573 ymin:-3.21016 xmax:525.936 ymax:82.5565
 label:2(car) confidence:0.823706 xmin:201.753 ymin:75.0368 xmax:496.356 ymax:286.378
 label:58(pottedplant) confidence:0.831631 xmin:525.485 ymin:8.54553 xmax:593.669 ymax:58.6099
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70956 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965731 xmin:427.567 ymin:-3.20357 xmax:525.942 ymax:82.5501
 label:2(car) confidence:0.822932 xmin:201.752 ymin:75.0237 xmax:496.374 ymax:286.358
 label:58(pottedplant) confidence:0.831683 xmin:525.485 ymin:8.54567 xmax:593.67 ymax:58.6106
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70957 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965694 xmin:427.563 ymin:-3.20653 xmax:525.944 ymax:82.5529
 label:2(car) confidence:0.82262 xmin:201.742 ymin:75.0221 xmax:496.383 ymax:286.355
 label:58(pottedplant) confidence:0.831713 xmin:525.487 ymin:8.54636 xmax:593.67 ymax:58.6116
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70958 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965538 xmin:427.534 ymin:-3.20451 xmax:525.993 ymax:82.5705
 label:2(car) confidence:0.821981 xmin:201.765 ymin:75.0907 xmax:496.224 ymax:286.457
 label:58(pottedplant) confidence:0.832714 xmin:525.479 ymin:8.54572 xmax:593.682 ymax:58.6116
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70959 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965596 xmin:427.541 ymin:-3.2048 xmax:525.982 ymax:82.57
 label:2(car) confidence:0.821054 xmin:201.734 ymin:75.0776 xmax:496.239 ymax:286.459
 label:58(pottedplant) confidence:0.832732 xmin:525.479 ymin:8.54589 xmax:593.682 ymax:58.6117
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70960 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965523 xmin:427.538 ymin:-3.2086 xmax:525.988 ymax:82.5748
 label:2(car) confidence:0.819717 xmin:201.703 ymin:75.0627 xmax:496.218 ymax:286.489
 label:58(pottedplant) confidence:0.833025 xmin:525.477 ymin:8.54506 xmax:593.685 ymax:58.6107
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70961 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965503 xmin:427.537 ymin:-3.20791 xmax:525.99 ymax:82.5745
 label:2(car) confidence:0.819567 xmin:201.702 ymin:75.0622 xmax:496.217 ymax:286.49
 label:58(pottedplant) confidence:0.832677 xmin:525.478 ymin:8.54397 xmax:593.684 ymax:58.6101
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70962 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965742 xmin:427.547 ymin:-3.20876 xmax:525.958 ymax:82.5593
 label:2(car) confidence:0.83119 xmin:201.638 ymin:75.1882 xmax:496.302 ymax:286.57
 label:58(pottedplant) confidence:0.832714 xmin:525.476 ymin:8.5436 xmax:593.684 ymax:58.6091
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70963 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965791 xmin:427.551 ymin:-3.20628 xmax:525.955 ymax:82.5578
 label:2(car) confidence:0.831561 xmin:201.645 ymin:75.187 xmax:496.289 ymax:286.573
 label:58(pottedplant) confidence:0.832735 xmin:525.473 ymin:8.54289 xmax:593.685 ymax:58.6081
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70964 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965765 xmin:427.548 ymin:-3.20467 xmax:525.958 ymax:82.5532
 label:2(car) confidence:0.831482 xmin:201.631 ymin:75.1904 xmax:496.296 ymax:286.576
 label:58(pottedplant) confidence:0.832705 xmin:525.475 ymin:8.54333 xmax:593.684 ymax:58.6086
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70965 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965729 xmin:427.543 ymin:-3.20832 xmax:525.964 ymax:82.5602
 label:2(car) confidence:0.830495 xmin:201.642 ymin:75.1837 xmax:496.292 ymax:286.568
 label:58(pottedplant) confidence:0.832542 xmin:525.478 ymin:8.54402 xmax:593.683 ymax:58.6115
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70966 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965809 xmin:427.549 ymin:-3.20573 xmax:525.957 ymax:82.5493
 label:2(car) confidence:0.836745 xmin:201.483 ymin:75.4276 xmax:496.472 ymax:286.592
 label:58(pottedplant) confidence:0.832442 xmin:525.477 ymin:8.54369 xmax:593.682 ymax:58.6114
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70967 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965809 xmin:427.549 ymin:-3.20573 xmax:525.957 ymax:82.5493
 label:2(car) confidence:0.836745 xmin:201.483 ymin:75.4276 xmax:496.472 ymax:286.592
 label:58(pottedplant) confidence:0.832442 xmin:525.477 ymin:8.54369 xmax:593.682 ymax:58.6114
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70968 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965809 xmin:427.549 ymin:-3.20573 xmax:525.957 ymax:82.5493
 label:2(car) confidence:0.836334 xmin:201.487 ymin:75.4293 xmax:496.47 ymax:286.591
 label:58(pottedplant) confidence:0.832442 xmin:525.477 ymin:8.54369 xmax:593.682 ymax:58.6114
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70969 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965816 xmin:427.551 ymin:-3.20633 xmax:525.956 ymax:82.5494
 label:2(car) confidence:0.835941 xmin:201.521 ymin:75.4019 xmax:496.419 ymax:286.626
 label:58(pottedplant) confidence:0.832404 xmin:525.477 ymin:8.54343 xmax:593.682 ymax:58.6113
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70970 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965852 xmin:427.554 ymin:-3.20343 xmax:525.953 ymax:82.5476
 label:2(car) confidence:0.836186 xmin:201.529 ymin:75.3993 xmax:496.41 ymax:286.633
 label:58(pottedplant) confidence:0.832441 xmin:525.475 ymin:8.54251 xmax:593.683 ymax:58.6099
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70971 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965814 xmin:427.551 ymin:-3.20351 xmax:525.957 ymax:82.5459
 label:2(car) confidence:0.836138 xmin:201.526 ymin:75.4048 xmax:496.422 ymax:286.628
 label:58(pottedplant) confidence:0.832406 xmin:525.476 ymin:8.54283 xmax:593.683 ymax:58.6105
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70972 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965814 xmin:427.55 ymin:-3.20645 xmax:525.957 ymax:82.5481
 label:2(car) confidence:0.835896 xmin:201.517 ymin:75.4017 xmax:496.423 ymax:286.627
 label:58(pottedplant) confidence:0.832458 xmin:525.477 ymin:8.5436 xmax:593.682 ymax:58.6113
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70973 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965705 xmin:427.506 ymin:-3.18307 xmax:525.986 ymax:82.5366
 label:2(car) confidence:0.837622 xmin:201.542 ymin:75.3882 xmax:496.4 ymax:286.612
 label:58(pottedplant) confidence:0.83173 xmin:525.482 ymin:8.53546 xmax:593.68 ymax:58.6116
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70974 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965705 xmin:427.506 ymin:-3.18307 xmax:525.986 ymax:82.5366
 label:2(car) confidence:0.837622 xmin:201.542 ymin:75.3882 xmax:496.4 ymax:286.612
 label:58(pottedplant) confidence:0.83173 xmin:525.482 ymin:8.53546 xmax:593.68 ymax:58.6116
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70975 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 label:2(car) confidence:0.965685 xmin:427.505 ymin:-3.18278 xmax:525.988 ymax:82.539
 label:2(car) confidence:0.837496 xmin:201.54 ymin:75.3882 xmax:496.4 ymax:286.612
 label:58(pottedplant) confidence:0.831759 xmin:525.482 ymin:8.53449 xmax:593.681 ymax:58.6116
car 0 left=533 top=1073741820 right=655 bottom=1073741926
car 0 left=251 top=93 right=618 bottom=356
Frame Number = 70976 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
End of stream
Returned, stopping playback
Deleting pipeline

Both the print statements are present in different locations, one is in the plugin while the other one is in the app. There’s no guarantee that both print bounding box information at the same time for the same object.

Here’s where its being printed in the plugin -
https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/blob/master/yolo/lib/yoloplugin_lib.cpp#L58

Here’e where it is attached to the metadata
https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/blob/master/yolo/plugins/gst-yoloplugin-tesla/gstyoloplugin.cpp#L553

https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/blob/master/yolo/plugins/gst-yoloplugin-tesla/gstyoloplugin.cpp#L665

Yeap,I read these source codes.(question1)And could you tell me which bbox information(plugin or metadata) is the right information with respect to the original input video frame image?I saw a scale_factor in
https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/blob/master/yolo/plugins/gst-yoloplugin-tesla/gstyoloplugin.cpp#L681
(question2)So the two print bbox above could match through this scale_factor,it this scale factor is the resize factor between the original frame size and the input data size which will be fed into the network?
(question3)And I got confused why I got minus value in plugin bbox coordinates and super huge abnormal bbox coordinates in metadate(I know because minus value convert to unsigned)??Is the problem with my input video(broken??) or could you give me some advice how to figure out this?

Frame Number = 70941 Number of objects = 3 Car Count = 2 Person Count = 0 Bicycle Count = 0 Truck Count = 0 
 <b>label:2(car) confidence:0.966848 xmin:427.629 ymin:-3.2225 xmax:525.836 ymax:82.5744</b>
 label:2(car) confidence:0.825751 xmin:201.432 ymin:75.3198 xmax:496.632 ymax:286.295
 label:58(pottedplant) confidence:0.827723 xmin:525.478 ymin:8.56573 xmax:593.75 ymax:58.685
<b>car 0 left=533 top=1073741820 right=655 bottom=1073741926</b>
car 0 left=251 top=93 right=619 bottom=355

If I set the processing size into 608x608 corresponding with the original yolov3 model,and the minus value seemed to disappear.Finally I could match the two print bbox information together.The original code setting is 608x480.so the reason is here??

Very thanks

  1. The final app metadata would be in your video input resolution, so you can ignore the one being printed in the plugin.

  2. Any incoming frame is being resized twice
    Video input res -> Plugin input resolution (processing width, height) -> network input resolution(416/ 608) and metadata is also scaled back accordingly.

  3. Not sure why you are seeing negative values, because every bounding box is clamped (0 - network dimensions) before being attached as metadata. See here -
    https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/blob/master/yolo/lib/trt_utils.cpp#L77

You can trace back where that box is getting changed to a negative value. My guess is that when the metadata is being scaled back its getting changed to an incorrect value.

Whats your video input resolution ?

1 Like

I want to get the detected bounding box info such as the label, confidence. But I think this answer is not valid now because I can any of this references. Please tell me a way to do it. Thanks

hi @malith,

Can you please create a new thread with more information regarding your setup, sample you are trying to run and any issues/questions you have ? Thanks

After going through the code I found the solution.

nvdsparsebbox_Yolo.cpp file contains the details of the detected objects. maxIndex variable carries the object label index which is related with labels.txt file.