MCPcopy Create free account
hub / github.com/XLearning-SCU/2022-CVPR-DART / __init__

Method __init__

utils.py:219–236  ·  view source on GitHub ↗
(self, dataset, train_color_label, train_thermal_label, shuffle=True)

Source from the content-addressed store, hash-verified

217
218class 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)))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected