Exemplo n.º 1
0
 def get_training_data(self):
     self.syn_loader = DataLoader(syn_dataset(train=True),
                                  batch_size=self.batch_size,
                                  shuffle=True,
                                  num_workers=4)
     self.real_loader = DataLoader(real_dataset(
         img_transform=self.img_transform,
         joint_transform=self.joint_transform,
         depth_transform=self.depth_transform),
                                   batch_size=self.batch_size,
                                   shuffle=True,
                                   num_workers=4)
Exemplo n.º 2
0
    def get_validation_data(self):
        self.syn_val_dataset = syn_dataset(train=False)
        self.syn_val_dataloader = DataLoader(self.syn_val_dataset,
                                             shuffle=False,
                                             batch_size=self.batch_size,
                                             num_workers=4)
        self.syn_val_sample_dataloader = DataLoader(self.syn_val_dataset,
                                                    shuffle=True,
                                                    batch_size=self.batch_size,
                                                    num_workers=4)
        self.syn_val_sample_images, self.syn_label = next(
            iter(self.syn_val_sample_dataloader))
        self.syn_val_sample_images = Variable(
            self.syn_val_sample_images.cuda())
        self.syn_label = (1.0 + self.syn_label) / 2.0

        self.real_val_dataset = real_dataset(
            data_file='test.txt',
            phase='test',
            img_transform=self.img_transform,
            joint_transform=self.joint_transform,
            depth_transform=self.depth_transform)
        self.real_val_dataloader = DataLoader(self.real_val_dataset,
                                              shuffle=False,
                                              batch_size=self.batch_size,
                                              num_workers=4)
        self.real_val_sample_dataloader = DataLoader(
            self.real_val_dataset,
            shuffle=True,
            batch_size=self.batch_size,
            num_workers=4)
        self.real_val_sample_images, self.real_val_sample_filenames = next(
            iter(self.real_val_sample_dataloader))
        self.real_val_sample_images = self.real_val_sample_images['left_img']
        self.real_val_sample_images = Variable(
            self.real_val_sample_images.cuda())
Exemplo n.º 3
0
 def get_validation_data(self):
     self.syn_val_dataloader = DataLoader(syn_dataset(train=False), batch_size=self.batch_size, shuffle=False, num_workers=4)
Exemplo n.º 4
0
 def get_training_data(self):
     self.syn_loader = DataLoader(syn_dataset(train=True,
                                              resize_mode='bicubic'),
                                  batch_size=self.batch_size,
                                  shuffle=True,
                                  num_workers=4)