def _reconfigure_dataloader_test(self): transform_rgb = transforms.Compose([ transforms.Scale(256), transforms.CenterCrop(self.net.input_spatial_size), transforms.ToTensor(), transforms.Normalize(self.mean, self.std) ]) transform_of = transforms.Compose([ transforms.Scale(256), transforms.CenterCrop(self.net.input_spatial_size), transforms.ToTensor(), transforms.SubMeanDisplacement() ]) transform_cod = transforms.Compose([ transforms.Scale(256), transforms.CenterCrop(self.net.input_spatial_size), transforms.ToTensor() ]) dataset_infos = [] for dataset_info_type in self.dataset_info_types: dataset_info = dataset_info_type(train=False, num_frames=self.num_frames_flow, split=self.split) dataset_infos.append(dataset_info) dataset = self.dataset_type(infos=dataset_infos, train=False, 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) self._reconfigure_dataloader(dataset, self.batch_size_test, shuffle=True)
def _reconfigure_dataloader_test(self): transform = transforms.Compose([ transforms.Scale(256), transforms.TenCrop(self.net.input_spatial_size), transforms.ToTensor()]) dataset_infos = [] for dataset_info_type in self.dataset_info_types: dataset_info = dataset_info_type(train=False, num_frames=self.num_frames, split=self.split) dataset_infos.append(dataset_info) dataset = self.dataset_type(infos=dataset_infos, train=False, transform=transform, num_test=self.num_test, num_frames=self.num_frames, nodiff=self.nodiff) self._reconfigure_dataloader(dataset, self.batch_size_test, shuffle=False)
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)