ImageNet#
- class streaming.vision.ImageNet(local, remote=None, split=None, shuffle=True, transform=None, target_transform=None, prefetch=100000, keep_zip=True, retry=2, timeout=60, hash=None, batch_size=None)[source]#
Implementation of the ImageNet dataset using streaming Dataset.
- Parameters
local (str) β Local filesystem directory where dataset is cached during operation.
remote (str, optional) β Remote directory (S3 or local filesystem) where dataset is stored. Defaults to
None
.split (str, optional) β The dataset split to use, either βtrainβ or βvalβ. Defaults to
None
.shuffle (bool, optional) β Whether to iterate over the samples in randomized order. Defaults to
True
.transform (callable, optional) β A function/transform that takes in an image and returns a transformed version. Defaults to
None
.target_transform (callable, optional) β A function/transform that takes in the target and transforms it. Defaults to
None
.prefetch (int, optional) β Target number of samples remaining to prefetch while iterating. Defaults to
100_000
.keep_zip (bool, optional) β Whether to keep or delete the compressed file when decompressing downloaded shards. If set to None, keep iff remote is local. Defaults to
None
.retry (int, optional) β Number of download re-attempts before giving up. Defaults to
2
.timeout (float, optional) β Number of seconds to wait for a shard to download before raising an exception. Defaults to
60
.hash (str, optional) β Hash or checksum algorithm to use to validate shards. Defaults to
None
.batch_size (int, optional) β Hint the batch size that will be used on each deviceβs DataLoader. Defaults to
None
.