(self, dataset, train_color_label, train_thermal_label, shuffle=True)
| 217 | |
| 218 | class AllSampler(Sampler): |
| 219 | def __init__(self, dataset, train_color_label, train_thermal_label, shuffle=True): |
| 220 | N1 = len(train_color_label) |
| 221 | N2 = len(train_thermal_label) |
| 222 | # N = np.maximum(len(train_color_label), len(train_thermal_label)) |
| 223 | if dataset == 'regdb': |
| 224 | index1 = np.concatenate((np.arange(N1), np.arange(20))) |
| 225 | index2 = np.concatenate((np.arange(N2), np.arange(20))) |
| 226 | else: |
| 227 | index1 = np.concatenate((np.arange(N1), np.arange(14))) |
| 228 | index2 = np.concatenate((np.arange(N2), np.arange(N1 - N2 + 14))) |
| 229 | |
| 230 | if shuffle: |
| 231 | np.random.shuffle(index1) |
| 232 | np.random.shuffle(index2) |
| 233 | |
| 234 | self.index1 = index1 |
| 235 | self.index2 = index2 |
| 236 | self.N = len(index1) |
| 237 | |
| 238 | def __iter__(self): |
| 239 | return iter(np.arange(len(self.index1))) |
nothing calls this directly
no outgoing calls
no test coverage detected