Datasets:

Modalities:
Image
Libraries:
Datasets
License:
Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
image
imagewidth (px)
336
482
End of preview. Expand in Data Studio

comma 5k

A 5k preview of comma.ai's self-driving dataset containing one-minute driving segments with road-camera video, logs, and full localization data.

Dataset collection

Segments were recorded by comma devices installed in real user vehicles. The collection spans several hardware generations (comma three, comma 3X, and comma four)

hw_types

Each segment includes a narrow FOV camera, wide FOV camera, preview thumbnail, log file with various measurements (GNSS, IMU, etc.), frame timing data, and offline localization data.

The offline localizer.safetensors is the result of an a fusion of raw GNSS measurements, accelerometer and gyroscope data, vehicle motion constraints, and visual feature tracks from the road cameras providing an accurate localization estimate.

Structure

data/
└── <segment_id>/
    β”œβ”€β”€ fcamera.hevc
    β”œβ”€β”€ ecamera.hevc
    β”œβ”€β”€ thumbnail.jpg
    β”œβ”€β”€ localizer.safetensors
    β”œβ”€β”€ frame_info.safetensors
    └── rlog.zst

Example usage

import numpy as np
import plotly.graph_objects as go
from huggingface_hub import hf_hub_download
from safetensors.numpy import load_file
from pymap3d import ecef2geodetic
from PIL import Image
segment_id = "001774ef60cf6c43657cd317035fae58"

thumbnail_path = hf_hub_download(
  repo_id="commaai/comma5k", repo_type="dataset",
  filename=f"data/{segment_id}/thumbnail.jpg",
)
Image.open(thumbnail_path).show()

tmpwp75ks43

localizer_path = hf_hub_download(
  repo_id="commaai/comma5k", repo_type="dataset",
  filename=f"data/{segment_id}/localizer.safetensors",
)
states = load_file(localizer_path)["states"]
latitude, longitude, _ = ecef2geodetic(*states[:, :3].T)
speed = np.linalg.norm(states[:, 7:10], axis=1)
fig = go.Figure()
fig.add_trace(go.Scattermap(lat=latitude[::10], lon=longitude[::10],
  mode="lines+markers", line={"color": "#ff4d4d", "width": 3},
  marker={"size": 6,"color": speed[::10],"colorscale": "Turbo","colorbar": {"title": "speed (m/s)"}}))
# span and zoom for map
span = max(float(np.ptp(latitude)), float(np.ptp(longitude)), 1e-6)
zoom = float(np.clip(np.log2(360.0 / span) - 1., 1, 18))
fig.update_layout(map={"style": "open-street-map","center": {"lat": float(np.mean(latitude)), "lon": float(np.mean(longitude))},"zoom": zoom},
  legend={"orientation": "h", "x": 0.01, "y": 0.01},
)
fig.show()
map
from openpilot.tools.lib.logreader import LogReader

rlog_path = hf_hub_download(
  repo_id="commaai/comma5k",
  repo_type="dataset",
  filename=f"data/{segment_id}/rlog.zst",
)

lr = LogReader(rlog_path)
speeds = [state.vEgo for state in lr.filter("carState")]
print(f"max speed: {max(speeds):.2f} m/s")
# max speed: 16.76 m/s
Downloads last month
6,473

Models trained or fine-tuned on commaai/comma5k