Add segmentation annotator support to Newton Warp renderer integration#6506
Add segmentation annotator support to Newton Warp renderer integration#6506rilei-nvidia wants to merge 5 commits into
Conversation
1466cb7 to
2a774dc
Compare
Greptile SummaryThis draft PR brings
Confidence Score: 2/5Not ready to merge — a leftover debug exception in the new segmentation module will crash every camera that requests a segmentation output, and all new unit tests will fail before running a single assertion. The
Important Files Changed
Reviews (1): Last reviewed commit: "Add segmentation outputs to Newton Warp ..." | Re-trigger Greptile |
| (id/color to prim path) and ``idToSemantics`` (id/color to semantic label). | ||
| """ | ||
|
|
||
| semantic_segmentation_mapping: dict = {} |
There was a problem hiding this comment.
Mutable default in config field
Using a bare dict literal {} as a class-level default is a Python antipattern; if NewtonWarpRendererCfg is not wrapped by a @configclass decorator that rewrites mutable defaults, all instances will share the same dict object. Consider using field(default_factory=dict) (for dataclass) or the framework's equivalent to make this safe regardless of the decorator.
| semantic_segmentation_mapping: dict = {} | |
| semantic_segmentation_mapping: dict = field(default_factory=dict) |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
2a774dc to
1b58988
Compare
dafbefa to
32f669f
Compare
32f669f to
04f121e
Compare
Add semantic_segmentation to the Newton Warp renderer and bring the existing instance_segmentation_fast up to full parity with the Isaac RTX renderer, including colorized RGBA output and idToLabels / idToSemantics metadata on camera.data.info. Newton emits only a per-shape index, so the three outputs are reconstructed on the host: shape indices are mapped to semantic / instance / instance-id spaces from model.shape_label prim paths and the USD stage's UsdSemantics.LabelsAPI labels, honoring semantic_filter and semantic_segmentation_mapping, then remapped into each output by a Warp kernel. Add the matching colorize_* / semantic_filter / semantic_segmentation_mapping fields to NewtonWarpRendererCfg. Extract the RTX/Replicator colorization (random_color_from_id / color_hash) into a shared isaaclab.renderers.segmentation_colors module so the Newton and OVRTX backends produce identical colors from a single source of truth; refactor the OVRTX kernels to use it. Update the camera docs support matrix, the Newton-supported data-type whitelists in the dexsuite and shadow_hand env configs, and the rendering correctness tests, and add golden images for the new outputs.
3a75d80 to
d7efc43
Compare
Description
Bring the segmentation annotators (
semantic_segmentation,instance_segmentation_fast) in the Newton Warp renderer integration to full parity with what the Isaac RTX renderer provides. This includes producing the idToLabels and/or idToSemantics dicts for mapping segmented IDs/colors to their respective prim path or semantic label.The main difference between supporting segmentation annotators for Newton warp vs ovrtx is that the Newton model only tracks the prim paths for each shape but not their semantic labels. So via the NewtonModel.shape_label array and its USD stage, we build the mappings from shape_index -> semantics upfront. Then there are warp kernels that process the shape index image into either an ID map or colorized map (see new golden images). All this logic is encapsulated in the new
isaaclab_newton/renderers/segmentation.pymodule.Light refactoring was done to share common variables / logic for around segmentation and colorization between the ovrtx and newton renderer integrations.
Type of change
Screenshots
See golden images
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there