Segmentation value mapping

For context, I am currently trying to create a UNet writer to add to the syntheticdata/offline_generation/generator.py script. Within the dataset config there needs to be a list of segmentation values to their corresponding label. Is there anyway to get the class label mapping from the synthetic data helper or from the scene itself?

I believe I have found the solution to my own problem. I found a useful function in synthetic data helpers that gets the instance mappings for every labeled object in the stage and that mapping contains the corresponding semantic id and label.

from omni.syntheticdata import helpers

instance_mapping = helpers.get_instance_mappings()
semantic_mapping = {id:label for id, label in zip(instance_mapping['semanticId'], instance_mapping['semanticLabel'])}
1 Like

@zach.s Glad that you found the solution!

1 Like

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