# Problem in getting rect\_params in deepstream 5 with jetson Xavier NX

**URL:** <https://forums.developer.nvidia.com/t/problem-in-getting-rect-params-in-deepstream-5-with-jetson-xavier-nx/147376>\
**Category:** DeepStream SDK\
**Created:** [August 18, 2020, 5:26pm UTC](https://forums.developer.nvidia.com/t/problem-in-getting-rect-params-in-deepstream-5-with-jetson-xavier-nx/147376 "2020-08-18T17:26:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdev20](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@rdev20](https://forums.developer.nvidia.com/u/rdev20)\
**Post date:** [August 18, 2020, 5:26pm UTC](https://forums.developer.nvidia.com/t/problem-in-getting-rect-params-in-deepstream-5-with-jetson-xavier-nx/147376/1 "2020-08-18T17:26:12Z")

</div>

Hi there

My problem is that when I want to capture the object bounding-box information, the value of top,left,height, width are not correct. Actually, top and left are half of real values and height and width are zero!  
I tested the code in Jetson TX2 and Jetson Nano (with the same JetPack and deepstream version), they works well and I have correct information about bounding-box. But in Jetson Xavier NX the problem is happened.  
I used the following code, this is the way that you used in deepstream\_imagedata-multistream.py DeepStream-python example.

obj\_meta=pyds.NvDsObjectMeta.cast(l\_obj.data)  
rect\_params = obj\_meta.rect\_params  
top = int(rect\_params.top)  
left = int(rect\_params.left)  
width = int(rect\_params.width)  
height = int(rect\_params.height)

My platform information:  
JetPack: 4.4 dp  
DeepStream sdk 5.0  
Jetson Xavier NX

I would appreciate it if you help me with this issue.  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![miguel.taylor](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/miguel.taylor/32/273049_2.png) [@miguel.taylor](https://forums.developer.nvidia.com/u/miguel.taylor)\
**Post date:** [August 18, 2020, 8:25pm UTC](https://forums.developer.nvidia.com/t/problem-in-getting-rect-params-in-deepstream-5-with-jetson-xavier-nx/147376/2 "2020-08-18T20:25:49Z")

</div>

If the code works on the TX2 and Nano, I suspect the the model is having problems on the Xavier. But I can’t tell for sure with the information you provided.

Are you sure that the object meta list is not `None`? Here is how I’m creating a Python dictionary from a buffer with DeepStream meta:

```auto
def nv_ds_label_info_to_dict(label_info):
  meta_dict = {}
  meta_dict['num_classes'] = label_info.num_classes
  meta_dict['result_label'] = label_info.result_label
  meta_dict['result_class_id'] = label_info.result_class_id
  meta_dict['label_id'] = label_info.label_id
  meta_dict['result_prob'] = label_info.result_prob
  return meta_dict

def nv_ds_classifier_meta_to_dict(classifier_meta):
  meta_dict = {}
  meta_dict['num_labels'] = classifier_meta.num_label
  meta_dict['unique_component_id'] = classifier_meta.unique_component_id
  meta_dict['label_info'] = []
  label_info_list = classifier_meta.label_info_list
  while label_info_list:
    label_info = pyds.NvDsLabelInfo.cast(label_info_list.data)
    meta_dict['label_info'].append(nv_ds_label_info_to_dict(label_info))
    label_info_list = label_info_list.next;
  return meta_dict

def nv_ds_object_meta_to_dict(object_meta):
  meta_dict = {}
  meta_dict['class_id'] = object_meta.class_id
  meta_dict['object_id'] = object_meta.object_id
  meta_dict['confidence'] = object_meta.confidence
  meta_dict['rect_params'] = {}
  meta_dict['rect_params']['left'] = object_meta.rect_params.left
  meta_dict['rect_params']['top'] = object_meta.rect_params.top
  meta_dict['rect_params']['width'] = object_meta.rect_params.width
  meta_dict['rect_params']['height'] = object_meta.rect_params.height
  meta_dict['text_params'] = {}
  meta_dict['text_params']['display_text'] = object_meta.text_params.display_text
  meta_dict['classifier'] = []
  classifier_meta_list = object_meta.classifier_meta_list
  while classifier_meta_list:
    classifier_meta = pyds.NvDsClassifierMeta.cast(classifier_meta_list.data)
    meta_dict['classifier'].append(nv_ds_classifier_meta_to_dict(classifier_meta))
    classifier_meta_list = classifier_meta_list.next;
  return meta_dict

def nv_ds_frame_meta_to_dict(frame_meta):
  meta_dict = {}
  meta_dict['frame_num'] = frame_meta.frame_num
  meta_dict['buf_pts'] = frame_meta.buf_pts
  meta_dict['ntp_timestamp'] = frame_meta.ntp_timestamp
  meta_dict['object'] = []
  obj_meta_list = frame_meta.obj_meta_list;
  while obj_meta_list:
    object_meta = pyds.NvDsObjectMeta.cast(obj_meta_list.data)
    meta_dict['object'].append(nv_ds_object_meta_to_dict(object_meta))
    obj_meta_list = obj_meta_list.next;
  return meta_dict

def nv_ds_batch_meta_to_dict(batch_meta):
    meta_dict = {'frame':[]}
    frame_meta_list = batch_meta.frame_meta_list
    while frame_meta_list:
      frame_meta = pyds.NvDsFrameMeta.cast(frame_meta_list.data)
      meta_dict['frame'].append(nv_ds_frame_meta_to_dict(frame_meta))
      frame_meta_list=frame_meta_list.next
    return meta_dict

def get_meta_dict_from_buffer(buf):
    batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(buf))
    if not batch_meta:
        return None
    return nv_ds_batch_meta_to_dict(batch_meta)

```

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:16pm UTC](https://forums.developer.nvidia.com/t/problem-in-getting-rect-params-in-deepstream-5-with-jetson-xavier-nx/147376/3 "2021-10-12T16:16:55Z")

</div>


