sparseml.utils.datasets package

Submodules

sparseml.utils.datasets.cifar module

sparseml.utils.datasets.coco module

sparseml.utils.datasets.helpers module

General helper functions for datasets in sparseml

sparseml.utils.datasets.helpers.default_dataset_path(name: str)str[source]
Parameters

name – name of the dataset to get a path for

Returns

the default path to save the dataset at

sparseml.utils.datasets.imagenet module

General utilities for the imagenet dataset implementations for the image classification field in computer vision. More info for the dataset can be found here.

sparseml.utils.datasets.imagenette module

General utilities for the imagenette and imagewoof dataset implementations for the image classification field in computer vision. More info for the dataset can be found here.

class sparseml.utils.datasets.imagenette.ImagenetteDownloader(download_root: str, dataset_size: sparseml.utils.datasets.imagenette.ImagenetteSize, download: bool)[source]

Bases: object

Downloader implementation for the imagenette dataset. More info on the dataset can be found here

Parameters
  • download_root – the local path to download the files to

  • dataset_size – which dataset size to download

  • download – True to run the download, False otherwise. If False, dataset must already exist at root.

property dataset_size

which dataset size to download

Type

return

property download

True to run the download, False otherwise. If False, dataset must already exist at root.

Type

return

property download_root

the local path to download the files to

Type

return

property extracted_root

Where the specific dataset was extracted to

Type

return

split_root(train: bool)str[source]
Parameters

train – True to get the path to the train dataset, False for validation

Returns

The path to the desired split for the dataset

class sparseml.utils.datasets.imagenette.ImagenetteSize(value)[source]

Bases: enum.Enum

Dataset size for Imagenette / Imagewoof. full does not resize the original dataset at all. s320 resizes the images to 320px. s160 resizes the images to 160px.

full = 'full'
s160 = 's160'
s320 = 's320'
class sparseml.utils.datasets.imagenette.ImagewoofDownloader(download_root: str, dataset_size: sparseml.utils.datasets.imagenette.ImagenetteSize, download: bool)[source]

Bases: object

Downloader implementation for the imagewoof dataset. More info on the dataset can be found here

Parameters
  • root – the local path to download the files to

  • dataset_size – which dataset size to download

  • download – True to run the download, False otherwise. If False, dataset must already exist at root.

property dataset_size

which dataset size to download

Type

return

property download

True to run the download, False otherwise. If False, dataset must already exist at root.

Type

return

property download_root

the local path to download the files to

Type

return

property extracted_root

Where the specific dataset was extracted to

Type

return

split_root(train: bool)str[source]
Parameters

train – True to get the path to the train dataset, False for validation

Returns

The path to the desired split for the dataset

sparseml.utils.datasets.voc module

Module contents

General utilities for datasets in sparseml