Data Readers Reference#
This page documents the data readers available in DALI Dynamic.
Once you create an instance of a reader, you can use it to iterate over the
data multiple times. To start a new iteration over the data, you can call the
next_epoch method, which will return an iterator that yields data.
If next_epoch is called without batch_size argument specified,
the reader will return individual samples. Otherwise, it will return batches
of the specified size. The batch size can differ from epoch to epoch.
import nvidia.dali.experimental.dynamic as ndd
reader = ndd.readers.File(file_root=images_dir)
for batch in reader.next_epoch(batch_size=16):
images_batch, labels_batch = batch
# process the batch
for batch in reader.next_epoch():
image, label = batch
# process the single sample
The table below lists the available readers.
Function |
Device support |
Short description |
|---|---|---|
CPU, GPU |
Reads Fits image HDUs from a directory. |
|
CPU, GPU |
Loads and decodes video files from disk. |
|
CPU |
Reads (Image, label) pairs from a Caffe LMDB. |
|
CPU |
Reads sample data from a Caffe2 Lightning Memory-Mapped Database (LMDB). |
|
CPU |
Reads data from a COCO dataset that is composed of a directory with images and annotation JSON files. |
|
CPU |
Reads file contents and returns file-label pairs. |
|
CPU |
Reads the data from an MXNet RecordIO. |
|
CPU |
Reads automatic speech recognition (ASR) data (audio, text) from an NVIDIA NeMo compatible manifest. |
|
CPU, GPU |
Reads Numpy arrays from a directory. |
|
CPU |
Reads [Frame] sequences from a directory representing a collection of streams. |
|
CPU |
Reads samples from a TensorFlow TFRecord file. |
|
GPU |
Loads and decodes video files using FFmpeg and NVDECODE, which is the hardware-accelerated video decoding feature in the NVIDIA(R) GPU. |
|
GPU |
Loads, decodes and resizes video files with FFmpeg and NVDECODE, which is NVIDIA GPU’s hardware-accelerated video decoding. |
|
CPU |
A reader for the webdataset format. |