Annotators Examples

Annotators provide you with the labeled synthetic data. Within replicator there are multiple off-the-shelf annotators. Through this tutorial we will show you what annotated data you can get and the output format.

Annotator Registry

The annotator registry is where all of the Annotators are. To get access to them, you can use the function AnnotatorRegistry.get_annotator(). The current annotators that are available through the registry are:

  • rgb

  • bounding_box_2d_loose

  • semantic_segmentation

  • instance_segmentation

  • distance_to_camera

  • distance_to_image_plane

  • bounding_box_3d

  • motion_vectors

  • occlusion

  • normals

To access them, some will have a couple of intiation parameters, for example for bounding boxes in the basicWriter we use the init_params={“semanticTypes”: semantic_types}). In the code line bellow we get the bounding box tight annotator.

AnnotatorRegistry.get_annotator("bounding_box_2d_tight", init_params={"semanticTypes": semantic_types})

To see how we have called annotators and use them for writing the data. You can check the scripts that implement the basic writer. How to get there is shown in Scripts for Replicator.

Annotator Output

Bellow is a short description of the output. For more information you can consult the scrip annotator_registry.py. (Follow instructions in Scripts for Replicator to find them).

RGB

The “rgb” annotator produces a 2d array of types np.uint8 with 4 channels.

Nomals

The “normals” annotator produces a 2d array of types np.uint32 with 4 channels.

Motion Vectors

The “motion_vectors” produces a 2darray of types np.uint32 with 4 channels.

Cross Correspondance

The “cross_correspondence” produces a 2d array of types np.uint32 with 4 channels.

Bounding Box 3D

The “bounding_box_3d” returns the instance and semantic ID, with the edges of the 3D bounding box with the transform as shown below:

np.dtype(
    [
        ("instanceId", "<u4"),
        ("semanticId", "<u4"),
        ("x_min", "<f4"),
        ("y_min", "<f4"),
        ("z_min", "<f4"),
        ("x_max", "<f4"),
        ("y_max", "<f4"),
        ("z_max", "<f4"),
        ("transform", "<f4", (4, 4)),
    ]
)

Bounding Box 2D tight

The “BoundingBox2DTight” annotator returns teh semantic id with the max x and y as well as the min x and y. As shown below:

np.dtype([("semanticId", "<u4"), ("x_min", "<i4"), ("y_min", "<i4"), ("x_max", "<i4"), ("y_max", "<i4")])

Bounding Box 2D loose

The “bounding_box_2d_loose” annotator returns teh semantic id with the max x and y as well as the min x and y. As shown below:

np.dtype([("semanticId", "<u4"), ("x_min", "<i4"), ("y_min", "<i4"), ("x_max", "<i4"), ("y_max", "<i4")])

Semantic Segmenetation

The “semantic_segmentation” returns a 2d array with type np.uint32.

Instance Segmentation

The “instance_segmentation” returns a 2d array with type np.uint32.

Distance to Image Plane

The “distance_to_image_plane” returns a 2d array with type np.uint32.

Distance to Camera

The “distance_to_camera” returns a 2d array with type np.uint32.