Lyft Dataset SDK

raw JSON →
0.0.8 verified Fri May 01 auth: no python maintenance

Python SDK for interacting with the Lyft Level 5 Prediction Dataset, providing tools for loading, visualizing, and analyzing autonomous vehicle sensor data (LIDAR, images, maps) and prediction/planning scenarios. Version 0.0.8 is the latest release; the library is in maintenance mode as Lyft has shifted focus to other projects.

pip install lyft-dataset-sdk
error ModuleNotFoundError: No module named 'lyft_dataset_sdk'
cause Library not installed or installed in wrong environment.
fix
Run pip install lyft-dataset-sdk in the correct Python environment.
error FileNotFoundError: [Errno 2] No such file or directory: '/path/to/dataset/v1.0-trainval'
cause The dataset path is incorrect or the dataset is not downloaded.
fix
Download the Lyft Level 5 dataset from https://level5.lyft.com/dataset/ and set data_path to the root directory containing e.g. 'v1.0-trainval'.
error TypeError: __init__() got an unexpected keyword argument 'json_path'
cause The constructor signature changed in later versions; 'json_path' was renamed or removed.
fix
Use data_path only and ensure the JSON files are in a 'data' subdirectory as per expected structure.
breaking In version >=0.0.6, the map API changed: `get_map` now requires a `map_name` parameter and returns a `NuScenesMap` object. Old code calling `get_map()` without arguments will break.
fix Update calls to `lyft_ds.get_map('map_name')`.
gotcha The Lyft dataset is large (hundreds of GB). Ensure sufficient disk space and memory. Loading the entire dataset may cause memory issues on machines with <16GB RAM.
fix Use `LyftDataset` with `verbose=False` and load only necessary scenes or samples.
deprecated The `get_sample_data` method for LIDAR point clouds is deprecated in favor of `get_sample_lidar`. It still works but may be removed in future.
fix Prefer `lyft_ds.get_sample_lidar(sample_token)`.

Initialize the LyftDataset and print first two scenes.

from lyft_dataset_sdk import LyftDataset
import os

data_path = os.environ.get('LYFT_DATA_PATH', '/path/to/dataset')
lyft_ds = LyftDataset(data_path=data_path, json_path=os.path.join(data_path, 'data'), verbose=True)
# List scenes
print(lyft_ds.scene[:2])