コード例 #1
0
 def _get_uniform_iter(self, samples, transform, p, k):
     '''
     load person reid data_loader from images_folder
     and uniformly sample according to class
     '''
     # dataset.sample is list  dataset.transform
     dataset = IncrementalReIDDataSet(samples,self.total_step, transform=transform)
     # ClassUniformlySampler
     loader = data.DataLoader(dataset, batch_size=p * k, num_workers=8, drop_last=False, sampler=ClassUniformlySampler(dataset, class_position=1, k=k))
     iters = IterLoader(loader)
     return iters
コード例 #2
0
 def _get_loader(self, samples, transform, batch_size):
     dataset = IncrementalReIDDataSet(samples, self.total_step, transform=transform)
     loader = data.DataLoader(dataset, batch_size=batch_size, num_workers=8, drop_last=False, shuffle=False)
     return loader