Exemple #1
0
    def __getitem__(self, idx):
        pair = self.pairs_fn[idx]

        style = load_img(pair[1], self.styleSize)

        content = load_img(pair[0], self.contentSize)

        return {
            'content': content,
            'contentPath': pair[0],
            'style': style,
            'stylePath': pair[1]
        }
Exemple #2
0
    def __getitem__(self, idx):
        pair = self.pairs_fn[idx]

        style = load_img(pair[1], self.styleSize)

        if self.synthesis:
            c_c, h_c, w_c = style.size()
            content = torch.zeros((c_c, h_c, w_c)).uniform_()
        else:
            content = load_img(pair[0], self.contentSize)

        return {
            'content': content,
            'contentPath': pair[0],
            'style': style,
            'stylePath': pair[1]
        }
    def __getitem__(self, idx):
        triplet = self.triplets_fn[idx]

        style0 = load_img(triplet[1], self.styleSize)
        style1 = load_img(triplet[2], self.styleSize)

        if self.synthesis:
            c_c, h_c, w_c = style0.size()
            content = torch.zeros((c_c, h_c, w_c)).uniform_()
        else:
            content = load_img(triplet[0], self.contentSize)

        return {
            'content': content,
            'contentPath': triplet[0],
            'style0': style0,
            'style0Path': triplet[1],
            'style1': style1,
            'style1Path': triplet[2]
        }
Exemple #4
0
 def __getitem__(self, idx):
     name = self.paintings[idx]
     path = os.path.join(self.dataDir, name)
     content = load_img(path, self.contentSize)
     return {'content': content, 'path': path, 'name': name}