def _reconfigure_dataloader_train(self): transform_rgb = transforms.Compose([ transforms.Scale(256), transforms.RandomCrop(self.net.input_spatial_size), transforms.RandomHorizontalFlip(), self.transform_color, transforms.ToTensor(), transforms.Normalize(self.mean, self.std) ]) transform_of = transforms.Compose([ transforms.Scale(256), transforms.RandomCrop(self.net.input_spatial_size), transforms.RandomHorizontalFlip(), transforms.ToTensor(), transforms.SubMeanDisplacement() ]) transform_cod = transforms.Compose([ transforms.Scale(256), transforms.RandomCrop(self.net.input_spatial_size), transforms.RandomHorizontalFlip(), transforms.ToTensor() ]) dataset_infos = [] for dataset_info_type in self.dataset_info_types: dataset_info = dataset_info_type(train=True, num_frames=self.num_frames_flow, split=self.split) dataset_infos.append(dataset_info) dataset = self.dataset_type(infos=dataset_infos, train=True, transform_rgb=transform_rgb, transform_of=transform_of, transform_cod=transform_cod, num_frames=self.num_frames_flow, num_frames_cod=self.num_frames_cod, modalities=self.modalities, high_motion=self.high_motion, time_flip=self.time_flip) self._reconfigure_dataloader(dataset, self.batch_size, shuffle=True)
def _reconfigure_dataloader_train(self): transform = transforms.Compose([ transforms.Scale(256), transforms.RandomCrop(self.net.input_spatial_size), transforms.RandomHorizontalFlip(), transforms.ToTensor()]) dataset_infos = [] for dataset_info_type in self.dataset_info_types: dataset_info = dataset_info_type(train=True, num_frames=self.num_frames, split=self.split) dataset_infos.append(dataset_info) dataset = self.dataset_type(infos=dataset_infos, train=True, transform=transform, num_frames=self.num_frames, nodiff=self.nodiff, time_flip=self.time_flip) self._reconfigure_dataloader(dataset, self.batch_size, shuffle=True)
def _reconfigure_dataloader_train(self): rgb = self.rgb transform = transforms.Compose([ transforms.Scale(256), transforms.RandomCrop(self.net.input_spatial_size), transforms.RandomHorizontalFlip(), transforms.RandomColorJitter(brightness=rgb, contrast=rgb, saturation=rgb, hue=rgb), transforms.ToTensor(), transforms.Normalize(self.mean, self.std)]) dataset_infos = [] for dataset_info_type in self.dataset_info_types: dataset_info = dataset_info_type(train=True, num_frames=1, split=self.split) dataset_infos.append(dataset_info) dataset = self.dataset_type(infos=dataset_infos, train=True, transform=transform) self._reconfigure_dataloader(dataset, self.batch_size, shuffle=True)