|
78 | 78 |
|
79 | 79 |
|
80 | 80 | data_dir = test_dir |
81 | | -image_datasets = {x: datasets.ImageFolder( os.path.join(data_dir,x) ,data_transforms) for x in ['gallery','query','multi-query']} |
82 | | -dataloaders = {x: torch.utils.data.DataLoader(image_datasets[x], batch_size=opt.batchsize, |
83 | | - shuffle=False, num_workers=16) for x in ['gallery','query','multi-query']} |
84 | 81 |
|
| 82 | +if opt.multi: |
| 83 | + image_datasets = {x: datasets.ImageFolder( os.path.join(data_dir,x) ,data_transforms) for x in ['gallery','query','multi-query']} |
| 84 | + dataloaders = {x: torch.utils.data.DataLoader(image_datasets[x], batch_size=opt.batchsize, |
| 85 | + shuffle=False, num_workers=16) for x in ['gallery','query','multi-query']} |
| 86 | +else: |
| 87 | + image_datasets = {x: datasets.ImageFolder( os.path.join(data_dir,x) ,data_transforms) for x in ['gallery','query']} |
| 88 | + dataloaders = {x: torch.utils.data.DataLoader(image_datasets[x], batch_size=opt.batchsize, |
| 89 | + shuffle=False, num_workers=16) for x in ['gallery','query']} |
85 | 90 | class_names = image_datasets['query'].classes |
86 | 91 | use_gpu = torch.cuda.is_available() |
87 | 92 |
|
@@ -159,11 +164,13 @@ def get_id(img_path): |
159 | 164 |
|
160 | 165 | gallery_path = image_datasets['gallery'].imgs |
161 | 166 | query_path = image_datasets['query'].imgs |
162 | | -mquery_path = image_datasets['multi-query'].imgs |
163 | 167 |
|
164 | 168 | gallery_cam,gallery_label = get_id(gallery_path) |
165 | 169 | query_cam,query_label = get_id(query_path) |
166 | | -mquery_cam,mquery_label = get_id(mquery_path) |
| 170 | + |
| 171 | +if opt.multi: |
| 172 | + mquery_path = image_datasets['multi-query'].imgs |
| 173 | + mquery_cam,mquery_label = get_id(mquery_path) |
167 | 174 |
|
168 | 175 | ###################################################################### |
169 | 176 | # Load Collected data Trained model |
|
0 commit comments