(dir_name)
| 40 | |
| 41 | |
| 42 | def 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 | |
| 53 | def get_split_domain_info_from_dir(domain_path, dataset_name=None, val_percentage=None, domain_label=None): |
no outgoing calls
no test coverage detected
searching dependent graphs…