Replicator YAML

Replicator YAML is a streamlined workflow for creating Synthetic Data with Replicator and Omniverse. The format uses the YAML format, a data interchange format. This tutorial will guide you through generating datasets with Replicator YAML.

You can find more Replicator YAML examples on our Synthetic Data Examples Github.

Learning Objectives

This tutorial includes the following:

  1. Replicator YAML Overview

  2. Running YAML scripts

  3. Example YAML scripts

  4. YAML Manual and Syntax Guide

Replicator YAML Overview

Replicator YAML is one of the four major workflows for creating synthetic data using Replicator. It focuses on workflows where simplicity, portability, and cloud are favored. As the name implies, scripts are written using YAML which is parsed into Replicator scripts and run to generate synthetic data.

Replicator YAML is intended for:

  • Low or no code users, situations where scripts are easily edited by non technical experts.

  • Where scripts need a high level of portability.

  • Cloud use cases.

Running YAML Scripts

Running a Replicator YAML script is largely the same as the traditional replicator script workflow. YAML scripts can be run using the UI through the Script Editor in Code, Isaac Sim, or other Kit Apps. Alternatively, YAML scripts can also be run headlessly, where the GUI is not shown and the app runs the script as a background process.

Enable the YAML extension

First, check whether the Replicator YAML Extension is enabled in your Kit App. With Code, you may need to manually enable the extension to use YAML with Replicator. Open the Extensions window using Menu > Window > Extensions. Type, ‘YAML’ into the search field, and you should see the ‘REPLICATORYAML’ extension. Verify it is enabled. Enable it, if it is not.


Running a script using the UI

For both Code and Isaac Sim, when the UI mode is enabled:

  1. Open Isaac Sim, Code or other Kit App with the UI enabled mode.

  2. Open the Script Editor from Menu > Window > Script Editor

  3. Paste the script from below in the Script Editor. Please change the file path details where the corresponding YAML file is stored.

  4. Click on the Run button to execute the script.

  5. Use the Replicator Menu for needed actions such as Preview, Step..etc.

from omni.replicator.replicator_yaml import parse
parser = parse(r"path_to_YAML_file")

Running a script Headlessly

Running replicator scripts headlessly is covered in Running Replicator Headlessly. However there are some differences for using YAML files as arguments.

.\omni.code.bat --no-window --/omni/replicator/replicatorYaml/yamlPath=<path_to_yaml_file>

For Isaac Sim, running the Replicator YAML workflow in headless mode is done the following way:

  1. Specify path of the YAML file as an Extra Args as follows:

  2. Following additional arguments can also be specified


For containers similar changes are required. In section 8, of the Deploy to Cloud page, you would instead use this command:

./ --allow-root --no-window --/omni/replicator/replicatorYaml/yamlPath=<path_to_yaml_file>

Example YAML Scripts

We have numerous Replicator YAML examples available. All are available on the Synthetic Data Examples Github.

  • Tutorial Basic Functionality

  • Tutorial Randomizer Colors

  • Tutorial Randomizer Dome Light

  • Tutorial Randomizer Instantiate

  • Tutorial Randomizer Light

  • Tutorial Randomizer Materials

  • Tutorial Randomizer Pose

  • Tutorial Randomizer Scatter Surface

  • Tutorial Randomize Textures

  • Multiple Cameras With Basic Writer

  • Randomize Camera Position List

  • Randomize Camera Position Uniformly

Below is the Tutorial Basic Functionality YAML script.

      meters_per_unit: 1

      up_axis: "Z"

      light_type: "distant"

      position: [10, 0, 0]

      camera: camera
      resolution: [1024, 1024]

      semantics: [["class", "torus"]]
      position: [1, 0, -2]

      semantics: [["class", "sphere"]]
      position: [1, 0, 1]

      semantics: [["class", "cube"]]
      position: [1, 1, -2]

      items: [torus, sphere, cube]

      max_execs: 10

               lower: [-1, -1, -1]
               upper: [2, 2, 2]
               lower: 0.1
               upper: 2

      name: "BasicWriter"
         output_dir: "_output_yaml/TutorialBasicFunctionality/"
         rgb: True
         bounding_box_2d_tight: True

      render_products: render_product

When run, the outputs should look like:


Replicator YAML Manual and Syntax Guide

The Replicator YAML Manual is a guide on the Replicator YAML syntax and structure. Topics discussed are:

  • Syntax

  • Valid Examples

  • Functions

  • Blocks

  • Inheritance

  • Global Parameters