Skip to content

Add semantic/depth image rendering to Python viewer - #2642

Open
Functionhx wants to merge 1 commit into
facebookresearch:mainfrom
Functionhx:feature/viewer-depth-semantic-display
Open

Add semantic/depth image rendering to Python viewer#2642
Functionhx wants to merge 1 commit into
facebookresearch:mainfrom
Functionhx:feature/viewer-depth-semantic-display

Conversation

@Functionhx

Copy link
Copy Markdown

Fixes #1752

Add support for displaying depth and semantic sensor observations in the Python interactive viewer (examples/viewer.py). Previously the viewer only supported RGB display via the color sensor.

Changes

  • Add --semantic-sensor and --depth-sensor CLI flags to enable additional sensors at startup
  • Add key bindings 1 (RGB), 2 (depth), 3 (semantic) to switch between sensor views at runtime
  • Depth observations are normalized and displayed as a grayscale visualization
  • Semantic observations use a deterministic multiplicative hash to map object IDs to consistent colors across frames
  • Raw OpenGL calls render the converted images as fullscreen textured quads (the C++ visualizeObservation() is not exposed to Python bindings)
  • Active display mode is shown in the on-screen HUD text overlay

Usage

python examples/viewer.py --scene /path/to/scene.glb --depth-sensor --semantic-sensor
# Press '2' for depth, '3' for semantic, '1' to return to RGB

Screenshots

(RGB, depth, and semantic views can be cycled with keys 1/2/3 at runtime)


🤖 Generated with Claude Code

Add support for displaying depth and semantic sensor observations in the
Python interactive viewer (examples/viewer.py). Previously the viewer
only supported RGB display via the color sensor.

Add --semantic-sensor and --depth-sensor CLI flags to enable additional
sensors at startup, and key bindings '1' (RGB), '2' (depth),
'3' (semantic) to switch between sensor views at runtime.

Depth observations are converted to a grayscale visualization. Semantic
observations use a deterministic multiplicative hash to map object IDs
to consistent colors. Raw OpenGL calls render the converted images as
fullscreen textured quads since the C++ visualizeObservation() is not
exposed to Python bindings.

Fixes facebookresearch#1752

Test Plan:
  python examples/viewer.py --scene /path/to/scene.glb --depth-sensor --semantic-sensor
  Press '2' for depth, '3' for semantic, '1' to return to RGB
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

generate semantic image in example/viewer.py

1 participant