Load Waymo Open Dataset in PyTorch
Project description
torch_waymo
Load Waymo Open Dataset in PyTorch
Cite this repository:
@software{Guimont-Martin_A_PyTorch_dataloader_2023,
author = {Guimont-Martin, William},
month = {1},
title = {{A PyTorch dataloader for Waymo Open Dataset}},
version = {0.1.1},
year = {2023}
}
Usage
Requires:
- Python < 3.10
Download the dataset
# Login to gcloud
gcloud auth login
# Download the full dataset
cd <path/to/waymo>
gsutil -m cp -r \
"gs://waymo_open_dataset_v_1_4_1/individual_files/training" \
"gs://waymo_open_dataset_v_1_4_1/individual_files/validation" \
.
Convert it
# Make a tf venv with Python < 3.10
python3.9 -m venv venv_tf
source venv_tf/bin/activate
# We recommend using uv for faster installs
pip install uv
uv pip install "torch_waymo[waymo]"
# Convert all splits (FULL frames with images & lasers) -> writes to <path>/converted
torch-waymo-convert --dataset <path/to/waymo>
# Convert only training split (FULL frames)
torch-waymo-convert --dataset <path/to/waymo> --splits training
# Convert multiple splits (FULL frames)
torch-waymo-convert --dataset <path/to/waymo> --splits training validation
# (NEW) Convert to SIMPLIFIED frames (no camera images stored, point cloud + labels only)
# Writes to <path>/converted_simplified
torch-waymo-convert --dataset <path/to/waymo> --simplified
# Simplified + specific splits
torch-waymo-convert --dataset <path/to/waymo> --simplified --splits training validation
Load it in your project
Now that the dataset is converted, you don't have to depend on waymo-open-dataset-tf-2-11-0 in your downstream project.
You can simply install torch_waymo in your runtime environment.
pip install torch_waymo
Example usage: train_dataset = WaymoDataset('~/Datasets/Waymo/converted_simplified', 'training') Example usage (Full conversion):
from torch_waymo import WaymoDataset
# Simplified frames (no images, only point clouds + labels)
train_dataset = WaymoDataset('~/Datasets/Waymo/converted_simplified', 'training')
for i in range(10):
# frame is of type SimplifiedFrame
frame = train_dataset[i]
print(frame.timestamp_micros)
print(frame.timestamp_micros, len(frame.lasers))
# Full frames (with images)
train_dataset = WaymoDataset('~/Datasets/Waymo/converted', 'training')
for i in range(10):
# frame is of type Frame
frame = train_dataset[i]
print(frame.timestamp_micros)
print(frame.timestamp_micros, len(frame.images))
Notes:
- Paths with
~are supported; they will expand to your home directory. len.pklinside each split directory stores cumulative frame counts for indexing.- If you re-run conversion, existing frames are skipped (idempotent per frame file).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torch_waymo-0.1.5.tar.gz.
File metadata
- Download URL: torch_waymo-0.1.5.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54a00f33effc05d89a36a17939ff122aa651bbc1773b057b1597e9fe848b186e
|
|
| MD5 |
370c2843bd038d9f818b27b641a76b73
|
|
| BLAKE2b-256 |
6d1882deaaf31d7dcfc6dba33fe556a16ec90573549b676429bbce26782b44e6
|
File details
Details for the file torch_waymo-0.1.5-py3-none-any.whl.
File metadata
- Download URL: torch_waymo-0.1.5-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
681221a83dfb7d25aeac2959c20f57c75f82dd1677d4a1b16aa6c3f58007a3e3
|
|
| MD5 |
0dc0fc46b528e64126fecd46dc1c35b8
|
|
| BLAKE2b-256 |
df4d463aa984f61164715754ae75576aa94cefe40af67e99de235357ec93a105
|