(self, resize, totensor, normalize, centercrop)
| 13 | self.train = train |
| 14 | |
| 15 | def transform(self, resize, totensor, normalize, centercrop): |
| 16 | options = [] |
| 17 | if centercrop: |
| 18 | options.append(transforms.CenterCrop(160)) |
| 19 | if resize: |
| 20 | options.append(transforms.Scale((self.imsize,self.imsize))) |
| 21 | if totensor: |
| 22 | options.append(transforms.ToTensor()) |
| 23 | if normalize: |
| 24 | options.append(transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))) |
| 25 | transform = transforms.Compose(options) |
| 26 | return transform |
| 27 | |
| 28 | def load_lsun(self, classes='church_outdoor_train'): |
| 29 | transforms = self.transform(True, True, True, False) |
no outgoing calls
no test coverage detected