Class: TorchVision::Datasets::ImageFolder

Inherits:
DatasetFolder show all
Defined in:
lib/torchvision/datasets/image_folder.rb

Constant Summary collapse

IMG_EXTENSIONS =
[".jpg", ".jpeg", ".png", ".ppm", ".bmp", ".pgm", ".tif", ".tiff", ".webp"]

Instance Attribute Summary

Attributes inherited from DatasetFolder

#classes

Attributes inherited from VisionDataset

#data, #targets

Instance Method Summary collapse

Methods inherited from DatasetFolder

#[], #size

Constructor Details

#initialize(root, transform: nil, target_transform: nil, is_valid_file: nil) ⇒ ImageFolder

Returns a new instance of ImageFolder.



6
7
8
9
# File 'lib/torchvision/datasets/image_folder.rb', line 6

def initialize(root, transform: nil, target_transform: nil, is_valid_file: nil)
  super(root, extensions: IMG_EXTENSIONS, transform: transform, target_transform: target_transform, is_valid_file: is_valid_file)
  @imgs = @samples
end