dataeval.utils.data.unzip_dataset

dataeval.utils.data.unzip_dataset(dataset, per_target)

Unzips a dataset into separate generators for images and targets.

This preserves performance by only loading each item from the dataset once.

Parameters:
dataset : Dataset

The dataset to unzip, which may contain images and optional targets.

per_target : bool

If True, extract bounding box targets from the dataset.

Returns:

Two iterators, one for images and one for targets.

Return type:

tuple[Iterator[NDArray[Any]], Iterator[list[BoundingBox] | None] | None]