From fab32096653573c0ecb8814fe4e3ca81cffc322d Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 12 Jan 2018 17:39:48 +0000 Subject: Should normalize input and truth images separately --- data/aligned_dataset.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'data') diff --git a/data/aligned_dataset.py b/data/aligned_dataset.py index bccd6fc..08155c8 100644 --- a/data/aligned_dataset.py +++ b/data/aligned_dataset.py @@ -27,7 +27,7 @@ class AlignedDataset(BaseDataset): AB_path = self.AB_paths[index] AB = Image.open(AB_path).convert('RGB') AB = AB.resize((self.opt.loadSize * 2, self.opt.loadSize), Image.BICUBIC) - AB = self.transform(AB) + AB = transforms.ToTensor()(AB) w_total = AB.size(2) w = int(w_total / 2) @@ -40,6 +40,9 @@ class AlignedDataset(BaseDataset): B = AB[:, h_offset:h_offset + self.opt.fineSize, w + w_offset:w + w_offset + self.opt.fineSize] + A = transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))(A) + B = transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))(B) + if self.opt.which_direction == 'BtoA': input_nc = self.opt.output_nc output_nc = self.opt.input_nc -- cgit v1.2.3-70-g09d2