Generate KITTI annotations from yaml file

I am following the replicator composer tutorial from here to generate scenes containing a scenario room with objects from 3 different classes. I wanted to train an object detection network on these objects. However, I can’t modify the output format to match KITTI format for annotations needed by detectnet_v2. Is there a way to specify a parameter in the yaml to override the default npy format for the output?

I would also be very interested in a guide or documentation on how to create a “custom” writer in replicator. API — omni_replicator 101.1.0 documentation is great for defining what to turn on and off with boolean values.
Describes how to do some logic and formatting, but the way data is parsed to the custom function is not clear to me. Is there documentation on how data is created and defined? How do I know what is available in data? What is the format? How can I add other things into this data object (for example, I want to record the camera pose and add it to the annotations). The following is a code snipped from the custom writer tutorial, which showcases the data object in question.

def write(self, data):
        if "rgb" in data and "bounding_box_2d_tight" in data:
            bbox_data = data["bounding_box_2d_tight"]["data"]
            id_to_labels = data["bounding_box_2d_tight"]["info"]["idToLabels"]


You should just be able to use the included KittiWriter instead of the BasicWriter (though I see the documentation hasn’t been updated to reflect this is available)

writer = rep.WriterRegistry.get("KittiWriter")
writer.initialize(output_dir = "kitti_output")

Available arguments for the KittiWriter:

            output_dir: Output directory to which KITTI annotations will be saved.
            semantic_types: List of semantic types to consider. If ``None``, only consider semantic types ``"class"``.
            omit_semantic_type: If ``True``, only record the semantic data (ie. ``class: car`` becomes ``car``).
            bbox_height_threshold: The minimum valid bounding box height, in pixels. Value must be positive integers.
            partly_occluded_threshold: Minimum occlusion factor for bounding boxes to be considered partly occluded.
            fully_visible_threshold: Minimum occlusion factor for bounding boxes to be considered fully visible.

Is there a way to specify output format in the yaml file as well? In the previous version, an additional parameter called writer_mode could be specified to save annotations in the Kitti format. This argument has now been deprecated in the current version

 ./ tools/composer/src/ \
--input parameters/warehouse.yaml --output */datasets/warehouse \
--num-scenes 10 --headless --mount <workspace>

Is there a replicator composer parameter that can change annotations from npy to kitti format? Thanks.

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