MCPcopy Create free account
hub / github.com/Closed11/Unsupervised-Image-Classification / listdir

Function listdir

UIC/dataset.py:6–13  ·  view source on GitHub ↗

Output the path of files in the folder with specific suffix

(folder, suffix)

Source from the content-addressed store, hash-verified

4from torch.utils.data import Dataset
5
6def listdir(folder, suffix):
7 """ Output the path of files in the folder with specific suffix"""
8 list_path = []
9 for root, _, files in os.walk(folder, followlinks=True):
10 for f in files:
11 if f.endswith(suffix):
12 list_path.append(osp.join(root, f))
13 return list_path
14
15class DatasetGivenLabels(Dataset):
16 """ A self-defined dataset with updated input labels"""

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected