From 3fe5623696de607f31ad264bf1ae843effa048e5 Mon Sep 17 00:00:00 2001 From: LielinJiang Date: Tue, 31 Mar 2020 12:26:03 +0000 Subject: [PATCH] refine folder.py --- datasets/folder.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/datasets/folder.py b/datasets/folder.py index 40ac5dc..2b724b4 100644 --- a/datasets/folder.py +++ b/datasets/folder.py @@ -45,7 +45,7 @@ def make_dataset(dir, class_to_idx, extensions=None, is_valid_file=None): class DatasetFolder(Dataset): - """A generic data loader where the samples are arranged in this way: :: + """A generic data loader where the samples are arranged in this way: root/class_a/1.ext root/class_a/2.ext @@ -62,7 +62,6 @@ class DatasetFolder(Dataset): both extensions and is_valid_file should not be passed. transform (callable, optional): A function/transform that takes in a sample and returns a transformed version. - E.g, ``transforms.RandomCrop`` for images. target_transform (callable, optional): A function/transform that takes in the target and transforms it. is_valid_file (callable, optional): A function that takes path of a file @@ -110,10 +109,9 @@ class DatasetFolder(Dataset): dir (string): Root directory path. Returns: - tuple: (classes, class_to_idx) where classes are relative to (dir), and class_to_idx is a dictionary. + tuple: (classes, class_to_idx) where classes are relative to (dir), + and class_to_idx is a dictionary. - Ensures: - No class is a subdirectory of another. """ if sys.version_info >= (3, 5): # Faster and available in Python 3.5 and above -- GitLab