Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
Jetson Xavier NX
• DeepStream Version
6.0.1
• JetPack Version (valid for Jetson only)
4.6
I have an application (in Python) that needs to make a cutout of the frame that’s taken from the gstreamer/deepstream pipeline through a buffer probe. Somehow though, the coordinates of the detected objects are incorrect.
Example:
This is de metadata I get:
{'type': 'object', 'class_id': 0, 'obj_label': 'Car', 'confidence': 0.8906721472740173, 'coordinates': (1088, 453, 1259, 576), 'x_left': 1088, 'x_right': 1259, 'y_top': 453, 'y_bottom': 576}
{'type': 'object', 'class_id': 0, 'obj_label': 'Car', 'confidence': 0.8321117758750916, 'coordinates': (715, 452, 985, 557), 'x_left': 715, 'x_right': 985, 'y_top': 452, 'y_bottom': 557}
{'type': 'object', 'class_id': 0, 'obj_label': 'Car', 'confidence': 0.79091477394104, 'coordinates': (1693, 466, 1851, 578), 'x_left': 1693, 'x_right': 1851, 'y_top': 466, 'y_bottom': 578}
{'type': 'object', 'class_id': 0, 'obj_label': 'Car', 'confidence': 0.24974358081817627, 'coordinates': (1864, 545, 1917, 595), 'x_left': 1864, 'x_right': 1917, 'y_top': 545, 'y_bottom': 595}
The OSD seems to be very accurate but the coordinates are not. I get this metadata by doing (redacted some info):
frame_meta = pyds.NvDsFrameMeta.cast(frame_meta_list.data)
obj_meta_list = frame_meta.obj_meta_list
obj_meta=pyds.NvDsObjectMeta.cast(obj_meta_list.data)
x_left = int(obj_meta.rect_params.left)
x_right = int(obj_meta.rect_params.left + obj_meta.rect_params.width)
y_top = int(obj_meta.rect_params.top)
y_bottom = int(obj_meta.rect_params.top + obj_meta.rect_params.height)
coordinates = (x_left, y_top, x_right, y_bottom)
obj_meta_dict = {
"type": "object",
"class_id": obj_meta.class_id,
"obj_label": obj_meta.obj_label,
"confidence": obj_meta.confidence,
"coordinates": coordinates,
"x_left": x_left,
"x_right": x_right,
"y_top": y_top,
"y_bottom": y_bottom
}
I have to use the rect_params because as far as I know those are the only coordinates I can get from the Python bindings? I found the
NvDsComp_BboxInfo _NvDsObjectMeta::detector_bbox_info
in the Deepstream API guide but this struct/object seems to be unreachable from Python. I.e. it’s not included in the bindings? But some links that should guide me to more information actually land on a generic page:
I believe the rect_params are somehow altered by some plugin in the pipeline. How do I get to the original bounding box coordinates of the detected objects?
PGIE (nvinfer) config:
[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-file=../deepstream_models/Primary_Detector/resnet10.caffemodel
proto-file=../deepstream_models/Primary_Detector/resnet10.prototxt
model-engine-file=../deepstream_models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
labelfile-path=../deepstream_models/Primary_Detector/labels.txt
int8-calib-file=../deepstream_models/Primary_Detector/cal_trt.bin
force-implicit-batch-dim=1
cluster-mode=3
batch-size=1
process-mode=1
model-color-format=0
network-mode=1
num-detected-classes=4
interval=0
gie-unique-id=1
output-blob-names=conv2d_bbox;conv2d_cov/Sigmoid
[class-attrs-all]
topk=5
Some help, documentation, examples, etc. would be greatly appreciated.