Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion torchvision/datasets/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,15 @@ class ImageFolder(DatasetFolder):
allow_empty(bool, optional): If True, empty folders are considered to be valid classes.
An error is raised on empty folders if False (default).

Attributes:
Attributes:
classes (list): List of the class names sorted alphabetically.
class_to_idx (dict): Dict with items (class_name, class_index).
imgs (list): List of (image path, class_index) tuples
Notes:
- Samples are sorted alphabetically by class name and file name.
- All samples from all classes are concatenated into a single list.
Indexing the dataset (e.g. dataset[i]) accesses this global list,
not a per-class subset.
"""

def __init__(
Expand Down
Loading