Skip to content

About

Turn driving logs into timestamped maneuver labels, with structured evidence and visual review.

Topics

Resources

Contributing

Stars

10 stars

Watchers

2 watching

Forks

Repository files navigation

DriveSceneMiner

From driving logs to reviewable scenes.

Quality checks Python 3.10+ Apache-2.0

Demo · Quick start · Usage · Schema · Contributing

Mine driving maneuvers from recorded vehicle data. Convert motion, lane geometry and object interactions into shared readable evidence, then classify each moment and merge it into timestamped scenes.

The current inference backend is Jev. DriveSceneMiner was previously named JevSceneMiner; the Python package and CLI remain jevsceneminer for compatibility.

Read the project write-up on Medium for the motivation, approach and lessons learned.

Boston highlights: turn right, lane change and lane following

Turn right → lane change → keep lane

Boston demo

Press Play below. If playback stalls after this page has been open for a while, refresh the page and press Play again.

boston-highlights-3p5x-dark-bev-1080p-compact.mp4

Real nuPlan footage and Jev results. 1080p · 1 min 22 s · 3.5× playback · long stops shortened. Demo details and data attribution.

What you can do

  • Shared evidence. Input adapters produce the same sample schema; missing evidence stays unknown.
  • Editable labels. Define lateral and longitudinal decisions in plain language, with probabilities for each answer.
  • Complete maneuvers. One lateral scene contains consecutive speed phases, such as decelerating, cruising and accelerating.
  • Evidence review. Synchronized camera, bird's-eye view (BEV), timeline, raw probabilities and ground-truth editing.

Recorded Jev performance

Benefit Detail
Fast batch inference 933 fresh samples in 25.9 s, using 8 workers.
Low inference cost Estimated $0.32 for that run, about $0.00034/sample.
Cloud-based inference Local preprocessing and review; readable evidence goes to TypeSafe's API. No local inference GPU.

One recorded Boston run with Jev 1.13; lateral and longitudinal questions share one request. See measurement conditions and pricing. Cost varies with context and questions.

What scene mining enables

Use reviewed scene labels for:

  • Data curation: measure scene coverage and guide further collection.
  • Scenario-based training: balance datasets and target weak driving behaviors.
  • Scenario-based validation: organize driving-performance metrics by scene.
  • Failure analysis: find maneuver patterns around recorded incidents.
  • Regression testing: reuse reviewed scene windows across model/software versions.
  • Dataset search and comparison: find maneuvers and compare scenario coverage.

Roadmap

Hybrid model + rule-based reasoning: opt-in experimental rules cover left/right turns, left/right lane changes, and stationary-obstacle avoidance. Accuracy gains require independent, held-out ground truth.

Pipeline

Autoware MCAP + Lanelet2 ─┐
                          ├─► preprocess ─► structured sample ─► Jev
nuPlan SQLite + map ──────┘                   facts + script      │
                                                                  ▼
                                                          raw probabilities
                                                                  │
                                                  merge lateral scenes + speed phases
                                                                  │
                                                     camera / BEV / timeline / GT

Jev receives the readable script, with past and future observations around NOW. Numerical facts remain alongside it for inspection. Camera images are used for review.

One lateral scene:       lane_change_right
Consecutive speed phases: decelerating │ cruising │ accelerating
Output:                  start_ns / end_ns / driving_decision / longitudinal_phases

See a complete sample, its Jev input and merged scenes.

Input adapters

Built-in adapters support nuPlan logs + maps and Autoware-topic MCAP rosbags + Lanelet2 maps.

Labs and companies can adapt their own recordings by developing preprocessing that produces the shared sample contract and session metadata; classification and scene merging can then be reused. Raw-format loading, coordinate alignment, map matching and camera review may need source-specific integration.

For a different format, follow Adapt your driving data: a conversion checklist and copyable coding-agent task for building and validating an adapter.

Quick start

Linux · Python 3.10+ · uv. Try the complete synthetic pipeline without an API key:

git clone https://github.com/bskkimm/DriveSceneMiner.git
cd DriveSceneMiner
uv sync --frozen
uv run python examples/pipeline_demo.py --source rosbag --out out/demo
uv run jevsceneminer view out/demo --gt out/demo-gt --port 8650

Open http://127.0.0.1:8650. The demo generates an MCAP, a map, processed samples and illustrative cached answers; API requests are blocked. It includes timeline and script data. Camera review requires your own nuPlan sources and images. Use --source nuplan with a new output directory to try the other adapter.

Run on supported inputs

# Prepare inputs without calling the API.
uv run jevsceneminer run \
  --nuplan /path/to/log.db --nuplan-maps /path/to/maps \
  --preset nuplan-1hz --out out/nuplan --dry-run

# Set TYPESAFE_API_KEY in your environment or an ignored .env file first.
uv run jevsceneminer classify out/nuplan --maneuver-tail 2
uv run jevsceneminer view out/nuplan --gt out/nuplan-gt \
  --sensor-root /path/to/sensor_blobs --port 8650

The explicit nuplan-1hz preset uses 10 s past + 15 s future, 1 Hz inference and a 1 Hz table. Without a preset, defaults are 10 s past + 10 s future at 2 Hz. See usage for rosbag inputs, options, outputs and remote viewing.

Documentation

Guide Contents
Usage Source setup, configuration, outputs and viewer
Adapt your driving data New source adapters, evidence checks and a coding-agent task
Sample and scene schema Context, lane/body evidence and consecutive phases
Evidence review Opt-in annotations, missing actor history and selected reruns
Evaluation Offline benchmark, independent GT and limitations
Repository layout Source groups and import compatibility
Contributing Development checks and contribution contracts
Changelog Release history

Status and license

Experimental, offline scene mining: future observations provide context. Map matching and polygon overlap are evidence, with physical lane ownership subject to source quality. The demo is a reviewed example; representative accuracy requires held-out evaluation.

Code and original synthetic examples: Apache-2.0. External recordings, maps and images retain their source terms. No raw driving dataset is included. This independent project is not affiliated with TypeSafe AI or the nuPlan authors.

About

Turn driving logs into timestamped maneuver labels, with structured evidence and visual review.

Topics

Resources

Contributing

Stars

10 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages