class documentation
class TorchImageDataset(Dataset): (source)
Constructor: TorchImageDataset(image_paths, samples, sample_ids, include_ids, ...)
A torch:torch.utils.data.Dataset
of images.
Instances of this dataset emit images for each sample, or (img, sample_id) pairs if sample_ids are provided or include_ids == True.
By default, this class will load images in PIL format and emit Torch tensors, but you can use numpy images/tensors instead by passing use_numpy = True.
Parameters | |
image | an iterable of image paths |
samples | a fiftyone.core.collections.SampleCollection
from which to extract image paths |
sample | an iterable of sample IDs corresponding to each image |
include | whether to include the IDs of the samples in the returned items |
transform | an optional transform function to apply to each image patch. When use_numpy == False, this is typically a torchvision transform |
use | whether to use numpy arrays rather than PIL images and Torch tensors when loading data |
force | whether to force convert the images to RGB |
skip | whether to return an Exception object rather than raising it if an error occurs while loading a sample |
Method | __getitem__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __len__ |
Undocumented |
Instance Variable | force |
Undocumented |
Instance Variable | image |
Undocumented |
Instance Variable | sample |
Undocumented |
Instance Variable | skip |
Undocumented |
Instance Variable | transform |
Undocumented |
Instance Variable | use |
Undocumented |
Property | has |
Whether this dataset has sample IDs. |
Method | _parse |
Undocumented |