MCPcopy Create free account
hub / github.com/lingeringlight/START / find_classes

Function find_classes

data/JigsawLoader.py:42–50  ·  view source on GitHub ↗
(dir_name)

Source from the content-addressed store, hash-verified

40
41
42def find_classes(dir_name):
43 if sys.version_info >= (3, 5):
44 # Faster and available in Python 3.5 and above
45 classes = [d.name for d in os.scandir(dir_name) if d.is_dir()]
46 else:
47 classes = [d for d in os.listdir(dir_name) if os.path.isdir(os.path.join(dir_name, d))]
48 classes.sort()
49 class_to_idx = {classes[i]: i+1 for i in range(len(classes))}
50 return classes, class_to_idx
51
52
53def get_split_domain_info_from_dir(domain_path, dataset_name=None, val_percentage=None, domain_label=None):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…