An error occurred while obtaining bbox_2d_loose data and empty data was returned

I have a USD scene with a pre-built camera. I need to access the information of the bounding_box_2d_loose for primitives based on the perspective of the camera to obtain occlusion information for these primitives.

The code I’m using is supposed to retrieve the bbox_loose data of an object, but in the initial few runs, it returns empty data along with some error messages. However, after running it multiple times, it eventually executes successfully and retrieves the data I need. I would like to know how to troubleshoot the errors and ensure that I can consistently obtain the required data every time.

The code i used:

from pxr import Usd
import omni.usd
import omni.replicator.core as rep
import omni.syntheticdata as sd

stage = omni.usd.get_context().get_stage()

sd.SyntheticData.Get().set_instance_mapping_semantic_filter("class:*")

cam = stage.GetPrimAtPath("/World/Camera")
rp = rep.create.render_product(str(cam.GetPrimPath()), (1024, 1024))

# Acess the data through annotators
bbox_loose = rep.AnnotatorRegistry.get_annotator("bounding_box_2d_loose")
bbox_loose.attach(rp)


async def get_bbox_loose_data():
    global bbox_loose
    await rep.orchestrator.step_async()
    data = bbox_loose.get_data()
    print(data)
    
import asyncio
asyncio.ensure_future(get_bbox_loose_data())

The error messages:

2023-10-02 14:45:24 [99,052ms] [Info] [omni.replicator.core.scripts.annotators] Attaching bounding_box_2d_loose to render product(s) ['/Render/RenderProduct_Replicator']
2023-10-02 14:45:24 [99,107ms] [Error] [omni.graph.core.plugin] Failed to get USD Attribute for /Render/PostProcess/SDGPipeline/RenderProduct_Replicator_bounding_box_2d_loose.inputs:bboxIds of type uint[]
2023-10-02 14:45:24 [99,107ms] [Error] [omni.graph.core.plugin] Failed to get USD Attribute for /Render/PostProcess/SDGPipeline/RenderProduct_Replicator_bounding_box_2d_loose.inputs:bufferSize of type uint
2023-10-02 14:45:24 [99,107ms] [Error] [omni.graph.core.plugin] Failed to get USD Attribute for /Render/PostProcess/SDGPipeline/RenderProduct_Replicator_bounding_box_2d_loose.inputs:data of type uchar[]
2023-10-02 14:45:24 [99,108ms] [Error] [omni.graph.core.plugin] Failed to get USD Attribute for /Render/PostProcess/SDGPipeline/RenderProduct_Replicator_bounding_box_2d_loose.inputs:exec of type uint (execution)
2023-10-02 14:45:24 [99,108ms] [Error] [omni.graph.core.plugin] Failed to get USD Attribute for /Render/PostProcess/SDGPipeline/RenderProduct_Replicator_bounding_box_2d_loose.inputs:height of type uint
2023-10-02 14:45:24 [99,108ms] [Error] [omni.graph.core.plugin] Failed to get USD Attribute for /Render/PostProcess/SDGPipeline/RenderProduct_Replicator_bounding_box_2d_loose.inputs:ids of type uint[]
2023-10-02 14:45:24 [99,108ms] [Error] [omni.graph.core.plugin] Failed to get USD Attribute for /Render/PostProcess/SDGPipeline/RenderProduct_Replicator_bounding_box_2d_loose.inputs:labels of type token[]
2023-10-02 14:45:24 [99,108ms] [Error] [omni.graph.core.plugin] Failed to get USD Attribute for /Render/PostProcess/SDGPipeline/RenderProduct_Replicator_bounding_box_2d_loose.inputs:primPaths of type token[]
2023-10-02 14:45:24 [99,108ms] [Error] [omni.graph.core.plugin] Failed to get USD Attribute for /Render/PostProcess/SDGPipeline/RenderProduct_Replicator_bounding_box_2d_loose.inputs:swhFrameNumber of type uint64
2023-10-02 14:45:24 [99,108ms] [Error] [omni.graph.core.plugin] Failed to get USD Attribute for /Render/PostProcess/SDGPipeline/RenderProduct_Replicator_bounding_box_2d_loose.inputs:width of type uint
2023-10-02 14:45:24 [99,121ms] [Info] [omni.replicator.core.scripts.orchestrator] Replicator Step
2023-10-02 14:45:24 [99,125ms] [Warning] [carb.flatcache.plugin] UsdRelationship /Render/RenderProduct_Replicator.orderedVars has multiple targets, which is not supported

2023-10-02 14:45:24 [99,133ms] [Warning] [omni.hydra] Disabling DLSS Frame Generation for at least one view due to incompatible render outputs and OmniGraph postprocessing being active
2023-10-02 14:45:24 [99,137ms] [Info] [rtx.multigpumanager.plugin] View 0 (/Render/RenderProduct_omni_kit_widget_viewport_ViewportTexture_0) assigned to device 0
2023-10-02 14:45:24 [99,137ms] [Info] [rtx.multigpumanager.plugin] View 0 (/Render/RenderProduct_omni_kit_widget_viewport_ViewportTexture_0) switching to 1x1 layout
2023-10-02 14:45:24 [99,137ms] [Info] [rtx.multigpumanager.plugin] View 1 (/Render/RenderProduct_Replicator) assigned to device 0
2023-10-02 14:45:24 [99,137ms] [Info] [rtx.multigpumanager.plugin] View 1 (/Render/RenderProduct_Replicator) switching to 1x1 layout
2023-10-02 14:45:25 [100,124ms] [Info] [omni.kit.menu.utils.scripts.utils] omni.kit.menu.utils.rebuild_menus
2023-10-02 14:45:25 [100,160ms] [Info] [omni.kit.menu.utils.scripts.utils] omni.kit.menu.utils.rebuild_menus
2023-10-02 14:45:25 [100,217ms] [Info] [omni.kit.menu.utils.scripts.utils] omni.kit.menu.utils.rebuild_menus
2023-10-02 14:45:26 [100,275ms] [Info] [omni.kit.app._impl] [py stdout]: {'data': array([],
      dtype=[('semanticId', '<u4'), ('x_min', '<i4'), ('y_min', '<i4'), ('x_max', '<i4'), ('y_max', '<i4'), ('occlusionRatio', '<f4')]), 'info': {'bboxIds': array([], dtype=uint32), 'idToLabels': {}, 'primPaths': []}}

2023-10-02 14:45:28 [102,640ms] [Info] [omni.meshraycast.plugin] Start refresh data for BVH
2023-10-02 14:45:28 [102,640ms] [Info] [omni.meshraycast.plugin] End refresh data for BVH early. Only refit is needed
2023-10-02 14:45:28 [102,640ms] [Info] [omni.meshraycast.plugin] End refresh data for BVH

get_bbox_loose_data_USD.zip (4.0 KB)

Hi @renton.hsu.vfx Those look like omnigraph errors from the generated replicator graph, and may be an old issue. Can you try this with Code 2023.1.1?

Thanks ! I appreciate your response to my question. Please convey my gratitude for your assistance.

Actually, I prefer working with Omniverse CODE 2022.3.3 because I’m currently in the midst of some development work, and I’ve noticed that the user interface in 2023.1.1 is different from 2022.3.3. For development purposes, I would like to stick with 2022.3.3 for the time being.

Nonetheless, I’ve managed to find a solution to the problem I described. It appears that the errors are related to two empty nodes in the rendering process, which seem to be annotator nodes created during the execution of the replicator API. Unfortunately, for reasons unknown, they became non-functional nodes, leading to the errors. Deleting these problematic nodes resolves the issue.

Once again, thank you for your assistance, and I’ll keep the information about the solution in mind for future reference.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.