Skip to main content
This guide shows how to train PyTorch models on Avala data. The recommended path streams annotated frames directly from Avala into a DataLoaderno exports.create, no archive download, no ETL. A static-export path is also documented for when you want a frozen snapshot.

Prerequisites

This installs the SDK plus the torch extra (PyTorch + Pillow). avala.torch provides two datasets that page lazily over your dataset’s items — each item already carries its presigned media URL and inline annotations, so a training run reads exactly the frames it needs without building an export.
Each sample is a dict:

Apply a transform

Pass a transform callable to shape each sample into model-ready tensors:

Multi-worker and Distributed Data Parallel

AvalaIterableDataset shards automatically:
  • DataLoader workers — each num_workers worker reads a disjoint slice; no duplicates.
  • DDP — rank/world size are read from torch.distributed when initialized, so every replica streams its own shard. Override explicitly with rank= / world_size= if you manage distribution yourself.

Need shuffling or indexed access?

Use the map-style AvalaDataset. It materializes the item list up front (one cursor walk) so it supports len() and random access, then fetches each item on access:
For large datasets, prefer AvalaIterableDataset for streaming throughput.

Static export (alternative)

When you want a reproducible, frozen snapshot (e.g. to archive a training set), create an export and load it from disk:

Next Steps