Using a script based on the “Running Replicator Headlessly” tutorial, I loaded a cardboard box from Nucleus and got different results when running the script in Code. The object can be found at
omniverse://localhost/NVIDIA/Assets/Isaac/2022.1/Isaac/Environments/Simple_Warehouse/Props/SM_CardBoxA_01.usd
I downloaded the usd file and added it to my input volume mount when running with the container.
docker run --gpus all --entrypoint bash --rm \
-v $PWD/replicator_input:/input \
-v $PWD/replicator_output:/root/omni.replicator_out/_output \
nvcr.io/nvidia/omniverse-replicator:1.4.7-r1 \
./startup.sh --allow-root --no-window --/omni/replicator/script=/input/test.py
The only difference in the script is I use the local USD file for the container while I use Nucleus from within Omniverse Code. The following script, headless_usd.py
, creates 10 images of a cardboard box with random orientation with left-right position between -3 and 3 world units. The camera is created from a primitive and placed about 10 units away.
import omni.replicator.core as rep
with rep.new_layer():
rep.create.light(light_type="Distant")
# Y axis is up
camera = rep.create.camera(position=(0, 1, 10))
render_product = rep.create.render_product(camera, (1024, 1024))
#boxA_file = 'omniverse://localhost/NVIDIA/Assets/Isaac/2022.1/Isaac/Environments/Simple_Warehouse/Props/SM_CardBoxA_01.usd'
boxA_file = '/input/SM_CardBoxA_01.usd'
def box_generator():
# Y-axis is up
box_obj = rep.create.from_usd(boxA_file, semantics=[('class', 'boxA')])
with box_obj:
rep.modify.pose(
position=rep.distribution.uniform((-3, 0, 0), (3, 0, 0)),
rotation=rep.distribution.uniform((-90,-45, 0), (-90, 45, 0)),
)
return box_obj
# Setup randomization and create 10 images
rep.randomizer.register(box_generator)
with rep.trigger.on_frame(num_frames=10):
rep.randomizer.box_generator()
writer = rep.WriterRegistry.get("BasicWriter")
writer.initialize(output_dir="_output", rgb=True, bounding_box_2d_tight=True)
writer.attach([render_product])
rep.orchestrator.run()
Using code the box looks great, but using the container, it looks like the textures are not present.
Could the material content be in a separate file in the Omniverse nucleus assets?