(is_train, config)
| 64 | |
| 65 | |
| 66 | def build_dataset(is_train, config): |
| 67 | transform = build_transform(is_train, config) |
| 68 | if config.DATA.DATASET == 'imagenet': |
| 69 | prefix = 'train' if is_train else 'val' |
| 70 | root = os.path.join(config.DATA.DATA_PATH, prefix) |
| 71 | dataset = datasets.ImageFolder(root, transform=transform) |
| 72 | nb_classes = 1000 |
| 73 | else: |
| 74 | raise NotImplementedError("We only support ImageNet Now.") |
| 75 | |
| 76 | return dataset, nb_classes |
| 77 | |
| 78 | |
| 79 | def build_transform(is_train, config): |
no test coverage detected