Home
Unified robotics dataset loader for time-series and annotated sensor data.
apairo handles the two fundamental layouts found in robotics datasets:
- Synchronous -- every index
ireturns a complete co-captured frame (semantic segmentation datasets) - Asynchronous -- multiple sensors firing at different rates, interleaved into a single timestamp-ordered timeline (rosbag extractions, TartanDrive)
At a glance
import apairo
# Synchronous: SemanticKITTI
ds = apairo.SemanticKittiDataset("/data/semantic_kitti", keys=["lidar", "labels"])
sample = ds[0]
# sample.data["lidar"] -> numpy.ndarray (N, 4) float32
# sample.data["labels"] -> numpy.ndarray (N,) int64
# Asynchronous: TartanDrive
ds = apairo.TartanKittiDataset("/data/tartan/2024-01-01_forest")
sample = ds[0]
# sample.data -> {"velodyne_0": tensor}
# sample.timestamp -> float
Supported datasets
| Class | Layout | Modalities |
|---|---|---|
SemanticKittiDataset |
synchronous | lidar, labels |
Rellis3DDataset |
synchronous | lidar, labels |
Goose3DDataset |
synchronous | lidar, labels |
RawDataset |
asynchronous | any channels (from .apairo/channels.yaml) |
TartanKittiDataset |
asynchronous | any TartanDrive v2 channel |
Key features
- YAML-driven dataset profiles -- adding a new synchronous dataset requires one
.yamlfile and two lines of Python - Derived key loading -- preprocessed outputs live alongside raw data, registered in a
.apairosidecar and loaded transparently - Preprocessing framework --
FramePreprocessorandSequencePreprocessorrun pipelines and persist results automatically (apairo_preprocessfor ready-made preprocessors) - At-access transforms --
dataset.transform(key, fn)andComposeapply callables at read time without writing to disk (apairo_transformfor ready-made transforms) - One chain from training to deployment --
ds.inference(outputs)keeps what a model's outputs need and drops augmentations,.on(source)replays it on another recording,.save()writes it as a JSON declaration beside the checkpoint - PyTorch-ready -- every apairo dataset implements the map-style protocol (
__getitem__/__len__), soDataLoaderaccepts it straight; samples arenumpy.ndarray, and apairo never imports torch - Sequence-level splits --
split_sequences()avoids temporal leakage across train/val/test
User guide
| Page | What it covers |
|---|---|
| Synchronization | synchronize(): an asynchronous recording resampled onto one clock, interpolation, persisted views |
| Transforms | transform() and Compose: callables applied at read time, published and temporary channels |
| Filtering | filter(): a view restricted to the frames that pass a predicate |
| Views & Caching | select() and cache(): channel projection, in-memory materialisation |
| Combining Datasets | concat() and join(): datasets stacked along frames or merged along channels |
| Preprocessing | FramePreprocessor and SequencePreprocessor: derived channels written to disk |
| Inference & Deployment | inference(), on(), save(): the training chain without its augmentations, replayed on another source and saved beside the model |