SUPERBUG: IsaacSim container 4.0.0 is randomly skipping semantic data (python)

Running in 4.0.0 we get around 10% of output images with no labels for boxes and pallets while the objects are clearly visible in the rgb outputs. This issue is not present in 2023.1.1. This problem together with Isaac v4.0.0 Container cannot load our YAML scenarios from v2023.1.1 - #8 by Turowicz is properly blocking us from upgrading to 4.0.0.

Video proving they all have semantics:

Example rgb output:

Example labels tight/loose output:

{}

Reproduction scenario:

import os
import random
import omni.replicator.core as rep

from pathlib import Path
from typing import Tuple
from usd_scene_construction_utils import (
    add_usd_ref,
    rotate_x,
    rotate_y,
    rotate_z,
    scale,
    compute_bbox,
    add_xform,
    compute_bbox_center,
    translate,
    set_visibility,
    new_omniverse_stage,
    add_dome_light,
    add_plane,
    add_mdl_material,
    bind_material
)

stage = new_omniverse_stage()

floor_materials = [
                    "/Replicator/Ref_Xform_01/Ref/Looks/Concrete_Floor_Damage",
                    "/Replicator/Ref_Xform_01/Ref/Looks/Concrete_Polished",
                    "/Replicator/Ref_Xform_01/Ref/Looks/Concrete_Precast",
                    "/Replicator/Ref_Xform_01/Ref/Looks/Spongy_Concrete_Weathered_Mossy_Dark_Dirt",
                    "/Replicator/Ref_Xform_01/Ref/Looks/Brass",
                    "/Replicator/Ref_Xform_01/Ref/Looks/Cast_Metal_Silver_Vein",
                    "/Replicator/Ref_Xform_01/Ref/Looks/Asphalt",
                    "/Replicator/Ref_Xform_01/Ref/Looks/Granite_Light",
                    "/Replicator/Ref_Xform_01/Ref/Looks/Gravel",
                    "/Replicator/Ref_Xform_01/Ref/Looks/Gravel_River_Rock",
                    "/Replicator/Ref_Xform_01/Ref/Looks/Slate",
                ]

box_asset_urls = [
                    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/DigitalTwin/Assets/Warehouse/Shipping/Cardboard_Boxes/Flat_A/FlatBox_A02_15x21x8cm_PR_NVD_01.usd",
                    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/DigitalTwin/Assets/Warehouse/Shipping/Cardboard_Boxes/Flat_A/FlatBox_A06_28x30x8cm_PR_NVD_01.usd",
                    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/DigitalTwin/Assets/Warehouse/Shipping/Cardboard_Boxes/Cube_A/CubeBox_A01_10cm_PR_NVD_01.usd",
                    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/DigitalTwin/Assets/Warehouse/Shipping/Cardboard_Boxes/Cube_A/CubeBox_A03_21cm_PR_NVD_01.usd",
                    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/DigitalTwin/Assets/Warehouse/Shipping/Cardboard_Boxes/Cube_A/CubeBox_A06_42cm_PR_NVD_01.usd",
                    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/DigitalTwin/Assets/Warehouse/Shipping/Cardboard_Boxes/Long_A/LongBox_A01_8x16x8cm_PR_NVD_01.usd",
                    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/DigitalTwin/Assets/Warehouse/Shipping/Cardboard_Boxes/Long_A/LongBox_A04_11x51x10cm_PR_NVD_01.usd",
                    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/DigitalTwin/Assets/Warehouse/Shipping/Cardboard_Boxes/White_A/WhiteCorrugatedBox_A03_15x15x15cm_PR_NVD_01.usd",
                    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/DigitalTwin/Assets/Warehouse/Shipping/Cardboard_Boxes/White_A/WhiteCorrugatedBox_A22_30x41x30cm_PR_NVD_01.usd",
                    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/DigitalTwin/Assets/Warehouse/Shipping/Cardboard_Boxes/White_A/WhiteCorrugatedBox_A31_25x30x15cm_PR_NVD_01.usd",
]
base_asset_urls = [
                         "http://omniverse-content-production.s3-us-west-2.amazonaws.com//Assets/DigitalTwin/Assets/Warehouse/Shipping/Pallets/Wood/Block_B/BlockPallet_B01_PR_NVD_01.usd",
                         "http://omniverse-content-production.s3-us-west-2.amazonaws.com//Assets/DigitalTwin/Assets/Warehouse/Shipping/Pallets/Wood/Block_B/BlockPallet_B02_PR_NVD_01.usd",
                         "http://omniverse-content-production.s3-us-west-2.amazonaws.com//Assets/DigitalTwin/Assets/Warehouse/Shipping/Pallets/Wood/Block_B/BlockPallet_B03_PR_NVD_01.usd",
                         "http://omniverse-content-production.s3-us-west-2.amazonaws.com//Assets/DigitalTwin/Assets/Warehouse/Shipping/Pallets/Metal/Aluminum_A/AluminumPallet_A01_PR_NVD_01.usd",
                         "http://omniverse-content-production.s3-us-west-2.amazonaws.com//Assets/DigitalTwin/Assets/Warehouse/Shipping/Pallets/Metal/Aluminum_A/AluminumPallet_A02_PR_NVD_01.usd",
                         "http://omniverse-content-production.s3-us-west-2.amazonaws.com//Assets/DigitalTwin/Assets/Warehouse/Shipping/Pallets/Metal/GalvanizedSteel_A/GalvanizedSteelPallet_A01_PR_NVD_01.usd",
                        #  "http://omniverse-content-production.s3-us-west-2.amazonaws.com//Assets/DigitalTwin/Assets/Warehouse/Shipping/Pallets/",
]

clutter_asset_urls = [
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Demos/AEC/BrownstoneDemo/Props/Hydrant/Hydrant.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Machinima/PostScriptum/Maps/EntryMap/Props/SM_trashcans.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/NVIDIA/Assets/ArchVis/Residential/Outdoors/Planters/SquareGardenPlanter_Tall.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/NVIDIA/Assets/ArchVis/Residential/Outdoors/Planters/Anza_Large.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/NVIDIA/Assets/ArchVis/Residential/Outdoors/Planters/ChippedPlanter_Large.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Machinima/PostScriptum/Maps/EntryMap/Props/SM_Workshop_Ladder.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Machinima/PostScriptum/Maps/EntryMap/Props/WoodenBox_Stack_C.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Machinima/BannerlordII/Props/market_potteryPile4.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Machinima/BannerlordII/Props/weapon_rack_vlandia_a.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Machinima/Squad/Stages/Desert/Props/Ace_Van.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/NVIDIA/Assets/Vegetation/Trees/Common_Apple.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/NVIDIA/Assets/Vegetation/Trees/Red_Oak.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/NVIDIA/Assets/Vegetation/Trees/Japanese_Maple_Fall.usd",
]
clutter_sm_asset_urls = [
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Simple_Warehouse/Props/SM_BarelPlastic_B_03.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Simple_Warehouse/Props/SM_BarelPlastic_C_02.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Simple_Warehouse/Props/SM_BottlePlasticA_02.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Simple_Warehouse/Props/SM_BottlePlasticB_01.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Simple_Warehouse/Props/SM_BottlePlasticA_02.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Simple_Warehouse/Props/SM_BottlePlasticA_02.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Simple_Warehouse/Props/SM_BottlePlasticD_01.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Simple_Warehouse/Props/SM_BottlePlasticE_01.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Simple_Warehouse/Props/SM_BucketPlastic_B.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Props/Forklift/forklift.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/Pharmacy_Low.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_BedSideTable_01b.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_BooksSet_26.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_BottleB.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_BottleA.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_BottleC.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_Cart_01a.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_Chair_02a.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_Chair_01a.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_Computer_02b.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_Desk_04a.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_DisposalStand_02.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_FirstAidKit_01a.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_GasCart_01c.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_Gurney_01b.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_HospitalBed_01b.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_MedicalBag_01a.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_Mirror.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_MopSet_01b.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_SideTable_02a.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_SupplyCabinet_01c.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_SupplyCart_01e.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_TrashCan.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_Washbasin.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Hospital/Props/SM_WheelChair_01a.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Office/Props/SM_WaterCooler.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Office/Props/SM_TV.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Office/Props/SM_TableC.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Office/Props/SM_Recliner.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Office/Props/SM_Personenleitsystem_Red1m.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Office/Props/SM_Lamp02_162.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Office/Props/SM_Lamp02.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Office/Props/SM_HandDryer.usd",
    "http://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/2023.1.1/Isaac/Environments/Office/Props/SM_Extinguisher.usd",
]

def add_box_of_size(
        stage,
        path: str, 
        size: Tuple[float, float, float]
    ):
    """Adds a box and re-scales it to match the specified dimensions
    """

    # Add USD box
    prim = add_usd_ref(stage, path, usd_path=box_asset_urls[random.randint(0, len(box_asset_urls) - 1)])

    rotate_x(prim, random.choice([-90, 0, 90, 180]))
    rotate_y(prim, random.choice([-90, 0, 90, 180]))

    # Scale USD box to fit dimensions
    usd_min, usd_max = compute_bbox(prim)
    
    usd_size = (
        usd_max[0] - usd_min[0],
        usd_max[1] - usd_min[1],
        usd_max[2] - usd_min[2]
    )

    required_scale = (
        size[0] / usd_size[0],
        size[1] / usd_size[1],
        size[2] / usd_size[2]
    )

    scale(prim, required_scale)
    return prim


def add_random_box_stack(
        stage,
        path: str, 
        count_range=(1, 5),
        size_range=((30, 30, 10), (50, 50, 25)),
        angle_range=(-5, 5),
        jitter_range=(-3,3)
    ):
    container = add_xform(stage, path)
    count = random.randint(*count_range)

    # get sizes and sort
    sizes = [
        (
            random.uniform(size_range[0][0], size_range[1][0]),
            random.uniform(size_range[0][1], size_range[1][1]),
            random.uniform(size_range[0][2], size_range[1][2])
        )
        for i in range(count)
    ]

    sizes = sorted(sizes, key=lambda x: x[0]**2 + x[1]**2, reverse=True)

    boxes = []
    for i in range(count):
        box_i = add_box_of_size(stage, os.path.join(path, f"box_{i}"), sizes[i])
        boxes.append(box_i)

    if count > 0:
        center = compute_bbox_center(boxes[0])
        for i in range(1, count):
            prev_box, cur_box = boxes[i - 1], boxes[i]
            cur_bbox = compute_bbox(cur_box)
            cur_center = compute_bbox_center(cur_box)
            prev_bbox = compute_bbox(prev_box)
            offset = (
                center[0] - cur_center[0],
                center[1] - cur_center[1],
                prev_bbox[1][2] - cur_bbox[0][2]
            )
            translate(cur_box, offset)
        
        # add some noise
        for i in range(count):
            rotate_z(boxes[i], random.uniform(*angle_range))
            translate(boxes[i], (
                random.uniform(*jitter_range),
                random.uniform(*jitter_range),
                0
            ))
    return container, boxes


def add_random_box_stacks(
        stage,
        path: str,
        base_bbox,
        count_range=(0, 3),
    ):
    container = add_xform(stage, path)
    stacks = []
    count = random.randint(*count_range)
    for i in range(count):
        stack, items = add_random_box_stack(stage, os.path.join(path, f"stack_{i}"),(1,10),((30, 30, 10), (base_bbox[1][0]*2, base_bbox[1][1]*2, 30)))
        stacks.append(stack)

    for i in range(count):
        cur_stack = stacks[i]
        cur_bbox = compute_bbox(cur_stack)
        cur_center = compute_bbox_center(cur_stack)
        translate(cur_stack, (0, -cur_center[1], -cur_bbox[0][2]))
        if i > 0:
            prev_bbox = compute_bbox(stacks[i - 1])
            translate(cur_stack, (prev_bbox[1][0] - cur_bbox[0][0], 0, 0))    
    return container, stacks
    
def add_pallet_stack(stage, path: str):

    container = add_xform(stage, path)

    base_path = f"{path}/truck"
    box_stacks_path = f"{path}/box_stacks"

    add_usd_ref(
        stage,
        base_path,
        base_asset_urls[random.randint(0, len(base_asset_urls) - 1)]
    )
    
    base_bbox = compute_bbox(container)
    box_stacks_container, box_stacks = add_random_box_stacks(stage, box_stacks_path, base_bbox, count_range=(0,6))
    rotate_z(box_stacks_container, 90)

    translate(
        box_stacks_container,
        offset=(0, random.uniform(8, 12), base_bbox[1][2])
    )

    # remove out of bounds stacks
    if(len(box_stacks)>0):
        last_visible = box_stacks[0]
        for i in range(len(box_stacks)):
            _, stack_bbox_max = compute_bbox(box_stacks[i])
            if stack_bbox_max[1] > (base_bbox[1][1] - base_bbox[0][1])*4/5:
                set_visibility(box_stacks[i], "invisible")
            else:
                last_visible = box_stacks[i]
        
        # wiggle inide bounds
        boxes_bbox = compute_bbox(last_visible)
        wiggle = (0 - boxes_bbox[1][1])
        translate(box_stacks_container, (0, random.uniform(0, wiggle), 1))
        
    return container

# Set settings
rep.settings.set_stage_up_axis(up_axis="Z")
rep.settings.set_stage_meters_per_unit(meters_per_unit=1)
rep.settings.set_render_pathtraced(samples_per_pixel=32)
rep.settings.carb_settings(setting="/omni/replicator/backend/writeThreads",value=24)

# Load the sky
rep.create.from_usd(usd="https://omniverse-content-production.s3.us-west-2.amazonaws.com/Environments/2023_1/DomeLights/Dynamic/CumulusLight.usd")

# Load the materials
rep.create.from_usd(usd="omniverse://10.100.1.30/Library/materials.usd")

# Select the objects in the stage
sky = rep.get.prim_at_path(path="/Replicator/Ref_Xform/Ref/Looks/SkyMaterial/Shader")

# Create cameras
cameras = []
camera = rep.create.camera(position=[0, 0, 0],rotation=[0, 0, 0])
camera_positions = [[200,0,0],[-2300,0,0],[200,2800,0],[-2300,2800,0],[200,-1300,0],[-2300,-1300,0]]
for camera_position in camera_positions:
    cameras.append(rep.create.camera(position=camera_position,rotation=[0, 0, 0]))

# Create output
render_products = []
render_products.append(rep.create.render_product(camera=camera,resolution=[1280, 720]))
for cam in cameras:
    render_products.append(rep.create.render_product(camera=cam,resolution=[1280, 720]))
    
writer = rep.writers.get(name="BasicWriter",
                        init_params={
                            "rgb": True,
                            "image_output_format": "jpg",
                            "bounding_box_2d_tight": True,
                            "bounding_box_2d_loose": True,
                            "instance_segmentation": True,
                            # "use_common_output_dir": True,
                            "semantic_filter_predicate": "class:*",
                            "output_dir": "/workspaces/Datasets.Generator.Omniverse/.out/scripted/pallet-stacks.py.d/"
                            }
                        )
writer.attach(render_products=render_products)

# Create scene
floor = rep.create.plane(scale=5000, position=[0, 0, 0])
boundary = rep.create.plane(scale=10000, position=[0, 0, -1])
all_objects_container = add_xform(stage, "/scene/objects")

# Create object groups        
rep_pallet_group=rep.get.xform(path_pattern="hand_truck_[0-9]*_[0-9]*\/truck")
rep_box_group=rep.get.xform(path_pattern="hand_truck_[0-9]*_[0-9]*\/box_stacks\/stack_[0-9]*\/box_[0-9]*")

# Create material groups
rep_pallet_material_group=rep.get.material(path_pattern="truck\/ref\/Looks")
rep_box_material_group=rep.get.material(path_pattern="box_stacks\/.*\/Looks")
rep_floor_material_group=rep.get.material(path_pattern="\/Replicator\/Ref_Xform_01")

# Set the trigger as on_frame
with rep.trigger.on_frame(max_execs=1429,rt_subframes=5,interval=2):
    with rep.new_layer(name="mylayer"):
        pallet_stacks=[]
        for i in range(9):
            for j in range(9):
                path = f"/scene/objects/hand_truck_{i}_{j}"
                current_object = add_pallet_stack(stage, path)
                translate(current_object, (200*i, 300*j, 0))
                pallet_stacks.append(path)
        
        # Set sun position and time of day
        with sky:
            rep.modify.attribute(name="inputs:SunPositionFromTOD",value=True)
            rep.modify.attribute(name="inputs:TimeOfDay",value=rep.distribution.uniform(lower=5.5,upper=19.5))

        # Randomize cameras
        with camera:
            rep.modify.pose(position=rep.distribution.uniform([-4500, -4500, 250],[4500, 4500, 750]),
                            rotation=rep.distribution.uniform([0, -30, -180],[0, 0, 180]))

        for cam in cameras:
            with cam:
                rep.modify.pose(position_z=rep.distribution.uniform(250,700),
                                rotation=rep.distribution.uniform([-10, -30, -180],[10, 0, 180]))

        # Randomize stacks
        with rep.create.group(pallet_stacks):
            rep.modify.pose(position=rep.distribution.uniform((-4500, -4500, 0), (4500, 4500, 0)),
                            rotation=rep.distribution.uniform((0, 0, 0), (0, 0, 360)))

        # Randomize box tints
        with rep_box_material_group:
            rep.modify.attribute(name="inputs:diffuse_tint",
                                 attribute_type="color3f",
                                 value=rep.distribution.uniform(lower=[0.0,0.0,0.0],
                                                                upper=[1.0,1.0,1.0]))

        # Randomize pallet tints
        with rep_pallet_material_group:
            rep.modify.attribute(name="inputs:diffuse_tint",
                                 attribute_type="color3f",
                                 value=rep.distribution.uniform(lower=[0.0,0.0,0.0],
                                                                upper=[1.0,1.0,1.0]))

        # Apply box semantics
        with rep_box_group:
            rep.modify.semantics(semantics=[("class","box")])

        # Apply pallet semantics
        with rep_pallet_group:
            rep.modify.semantics(semantics=[("class","pallet")])

        # Randomize floor
        with floor:
            rep.modify.material(value=floor_materials)

        # Randomize boundary
        with boundary:
            rep.modify.material(value=floor_materials)

        # Randomize floor materials tints
        with rep_floor_material_group:
            rep.modify.attribute(name="inputs:diffuse_tint",
                                 attribute_type="color3f",
                                 value=rep.distribution.uniform(lower=[0.0,0.0,0.0],
                                                                upper=[1.0,1.0,1.0]))

        # Randomize clutter
        with rep.randomizer.instantiate(paths=clutter_asset_urls,size=50,mode="scene_instance"):
            rep.modify.pose(scale=rep.distribution.uniform(0.8,1.2),
                            rotation=rep.distribution.uniform([0, 0, -180],[0, 0, 180]))
            rep.randomizer.scatter_2d(seed=1100,surface_prims=[floor,boundary],check_for_collisions=True)

        # Randomize sm clutter
        with rep.randomizer.instantiate(paths=clutter_sm_asset_urls,size=50,mode="scene_instance"):
            rep.modify.pose(scale=rep.distribution.uniform(80,120),
                            rotation=rep.distribution.uniform([0, 0, -180],[0, 0, 180]))
            rep.randomizer.scatter_2d(seed=1200,surface_prims=[floor,boundary],check_for_collisions=True)

Reproduction script

#!/bin/bash

#set -e

FILE=$1

echo $FILE

if [ -f "$FILE" ]; then
    /isaac-sim/runheadless.native.sh  --no-window \
                                      --/app/viewport/grid/enabled=false \
                                      --/app/viewport/defaults/guide/grid/visible=false \
                                      --/omni/replicator/script=$FILE
    exit $?
else
    echo "File not found: $FILE"
    exit 1
fi

cc @pcallender @dennis.lynch

@jlafleche perhaps you want to also check this problem out.

1 Like

Investigating this. Thank you for all the information to help get to the bottom of it!

Hello @Turowicz, I just wanted to provide an update. We have been able to reproduce the issue you’re observing. In fact I can see that during generation certain boxes/pallets no longer seem to show as semantically labelled to the annotator, and this can be seen in the live visualization as well. Saving the USD at this point and re-openning it seems to resolve the issue. We’re still investigating and will update once we find out more. Thanks again for catching this and posting repro steps.

1 Like

This is a show stopper to me. I cannot proceed without proper outputs. I am absolutely blocked from achieving anything with this tool.

@jlafleche @hclever @pcallender @dennis.lynch

Do you mean saving the USD after executing the randomizer script?

That’s actually incorrect. In my live preview all is well. Only the writer is broken. The pallets without semantics you see in my video are clutter assets which aren’t meant to be labelled. Its a coincidence that they also have pallets in them.

Now that 3 of my major issues have been fixed, I only need this one to work so I can get on with life and get back to wife and kids.

PLEASE HELP ME

The solution was to do nothing. I don’t know what changed but suddenly all labels are there. @jlafleche I will close this issue keeping in mind you are tracking this internally.

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