def __init__(self, mean_std_file, perform_scale_perturbation):
     super(HDRImageHandler, self).__init__()
     self.tn = TonemapHDR(gamma=1.4, percentile=90, max_mapping=0.8)
     self.dataset_mean, self.dataset_std = dataset_stats_load(mean_std_file)
     self.normalization_ops = [transforms.Compose([Scale(random_perturbation=perform_scale_perturbation),
                                                   Log1p(),
                                                   NumpyImage2Tensor(),
                                                   Normalize(self.dataset_mean,
                                                             self.dataset_std)])]
Пример #2
0
    def __init__(self, mean_std_file):
        super(LDRImageHandler, self).__init__()

        self.dataset_mean, self.dataset_std = dataset_stats_load(mean_std_file)
        self.normalization_ops = [
            transforms.Compose([
                ToFloat(),
                NumpyImage2Tensor(),
                Normalize(self.dataset_mean, self.dataset_std)
            ])
        ]