(config)
| 56 | |
| 57 | |
| 58 | def prepare_testing_data(config): |
| 59 | def get_test_data_loader(config, test_name): |
| 60 | # update the config dictionary with the specific testing dataset |
| 61 | config = config.copy() # create a copy of config to avoid altering the original one |
| 62 | config['test_dataset'] = test_name # specify the current test dataset |
| 63 | test_set = DeepfakeAbstractBaseDataset( |
| 64 | config=config, |
| 65 | mode='test', |
| 66 | ) |
| 67 | test_data_loader = \ |
| 68 | torch.utils.data.DataLoader( |
| 69 | dataset=test_set, |
| 70 | batch_size=config['test_batchSize'], |
| 71 | shuffle=False, |
| 72 | num_workers=int(config['workers']), |
| 73 | collate_fn=test_set.collate_fn, |
| 74 | drop_last=False |
| 75 | ) |
| 76 | return test_data_loader |
| 77 | |
| 78 | test_data_loaders = {} |
| 79 | for one_test_name in config['test_dataset']: |
| 80 | test_data_loaders[one_test_name] = get_test_data_loader(config, one_test_name) |
| 81 | return test_data_loaders |
| 82 | |
| 83 | |
| 84 | def choose_metric(config): |
no test coverage detected