Example #1
0
 def __init__(self, opt, data_num=None):
     self.opt = opt
     self.annotation_path = opt.infer_dataset_path
     self.isTrain = False
     self.data_list = data_utils.load_from_annotation(self.annotation_path)
     # pad data list so that the number of data can be divisible by batch size
     # the redundant data will be removed after the whole dataset has been processed
     add_num = opt.batchSize - len(self.data_list)%opt.batchSize
     self.data_list += self.data_list[:add_num]
     # transform list        
     transform_list = [transforms.ToTensor(),
                       transforms.Normalize((0.5, 0.5, 0.5),
                                            (0.5, 0.5, 0.5))]
     self.transform = transforms.Compose(transform_list)
     self.data_processor = DataProcessor(opt)
    def __init__(self, opt, data_num=0):
        self.opt = opt
        self.annotation_path = opt.human36m_anno_path
        self.isTrain = opt.isTrain

        data_list = self.load_annotation(self.annotation_path)
        data_list = sorted(data_list, key=lambda a:a['image_path'])
        self.update_path(opt.data_root, data_list)

        if opt.isTrain and data_num > 0:
            data_num = min(data_num, len(data_list))
            data_list = random.sample(data_list, data_num)
        self.data_list = data_list

        transform_list = [ transforms.ToTensor(),
                          transforms.Normalize((0.5, 0.5, 0.5),
                                               (0.5, 0.5, 0.5))]
        self.transform = transforms.Compose(transform_list)
        self.data_processor = DataProcessor(opt)
    def __init__(self, opt):
        self.opt = opt
        self.annotation_path = opt.up3d_anno_path
        self.isTrain = opt.isTrain
        self.refine_IUV = opt.refine_IUV
        self.dp_num_max = opt.dp_num_max

        data_list = self.load_annotation(self.annotation_path)
        data_list = sorted(data_list, key=lambda a: a['image_path'])
        self.update_path(opt.data_root, data_list)
        self.data_list = data_list

        if not opt.isTrain:
            add_num = opt.batchSize - len(self.data_list) % opt.batchSize
            self.data_list += self.data_list[:add_num]

        transform_list = [
            transforms.ToTensor(),
            transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))
        ]
        self.transform = transforms.Compose(transform_list)
        self.data_processor = DataProcessor(opt)