Skip to content

ryanhlewis/scenarionet-editor

Repository files navigation

ScenarioNet Editor

A quick-and-dirty Vite + React workstation for poking at WOMD-style scenarios. You can:

  • load .pkl scenes (via Pyodide) or Waymo Motion .tfrecord(.s) scenarios,
  • view baseline vs edited maps with Deck.GL,
  • scrub/play ground-truth tracks with the bottom playback bar,
  • tweak lanes (scale/taper/chicane) plus agent + stop-sign metadata, then save back to PKL.

Getting Started

npm install
npm run dev

Open the app, drop a .pkl, .tfrecord, or .tfrecords file into the Open input inside the left toolbar, then use the viewport controls + toolbar sliders to explore.

TFRecord support

loadTFRecord depends on a protobuf descriptor the browser can read. Generate it once and place it under public/ so fetch('scenario.descriptor.json') succeeds:

npm install --save-dev protobufjs-cli

# assuming you have the Waymo protos under src/protos/waymo_open_dataset/protos
npx pbjs \
  -t json \
  -o public/scenario.descriptor.json \
  src/protos/waymo_open_dataset/protos/scenario.proto \
  src/protos/waymo_open_dataset/protos/map.proto \
  src/protos/waymo_open_dataset/protos/camera_tokens.proto \
  src/protos/waymo_open_dataset/protos/compressed_lidar.proto

If you already have a scenario.descriptor.json, simply copy it into public/.

Once present, loading a TFRecord will populate both map features and scene.tracks, which the Deck playback UI consumes automatically.

Rollout API hook

  • The Rollout API card in the left toolbar stores its URL in localStorage (defaults to http://localhost:8000/rollout).
  • Hit the Rollout button next to the playback controls to serialize the currently edited scene to PKL, POST it to /rollout, and preview the GIF result in-app (with download link).
  • Errors from the API are shown in the lower-right toast; update the endpoint if you don't see results.

Saving PKLs

All edits stay in-browser. Use the Save .pkl button to download the modified scene. Licensing compliance for the datasets you use remains your responsibility.

Releases

No releases published

Packages

No packages published