Modifiyng object meta using python bindings

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
Jetson TX2
• DeepStream Version
• JetPack Version (valid for Jetson only)
4.4 [L4T 32.4.3]
• TensorRT Version

I want to enlarge the output bounding boxes of my primary detector, before feeding them into the secondary classifier, using the deepstream python bindings.

I think it can be achieved following up on the deepstream ssd parser example:

Basically, I want to do something like:

obj_meta.rect_params.left = obj_meta.rect_params.left -10 
obj_meta.rect_params.width = obj_meta.rect_params.width + 10

I have tried different things with no success, could you give me some clues?

Sorry, after some tries I think I found the answer myself.

l_frame = batch_meta.frame_meta_list
    while l_frame is not None:
            # Note that needs a cast to pyds.NvDsFrameMeta
            # The casting is done by pyds.glist_get_nvds_frame_meta()
            # The casting also keeps ownership of the underlying memory
            # in the C code, so the Python garbage collector will leave
            # it alone.
            # frame_meta = pyds.glist_get_nvds_frame_meta(
            frame_meta = pyds.NvDsFrameMeta.cast(
        except StopIteration:
        l_obj = frame_meta.obj_meta_list
        new_objs = []
        while l_obj is not None:
                # Casting to pyds.NvDsObjectMeta
                org_obj_meta = pyds.NvDsObjectMeta.cast(
                # insert a single object.
                new_obj_meta = pyds.nvds_acquire_obj_meta_from_pool(batch_meta)
                # Set bbox properties. These are in input resolution.
                rect_params = org_obj_meta.rect_params
                # enlarge original box
                delta_width = org_obj_meta.rect_params.width * width_ratio
                new_left = max(0, (org_obj_meta.rect_params.left - delta_width // 2))
                new_width = org_obj_meta.rect_params.width + delta_width
                delta_height = org_obj_meta.rect_params.height * height_ratio
                new_top = max(0, ( - delta_height // 2))
                new_height = org_obj_meta.rect_params.width + delta_height
                rect_params.left = new_left
       = new_top
                rect_params.width = new_width
                rect_params.height = new_height
                new_obj_meta.class_id = org_obj_meta.class_id
                new_obj_meta.confidence = org_obj_meta.confidence
            except StopIteration:
                l_obj =
            except StopIteration:
        for new_obj_meta in new_objs:
            pyds.nvds_add_obj_meta_to_frame(frame_meta, new_obj_meta, None)
            print("added new_obj_meta")
            l_frame =
        except StopIteration:

The important part is to write the new object outside of the reading loop.