Skip to content

Instantly share code, notes, and snippets.

@J3698
Last active June 27, 2021 18:15
Show Gist options
  • Save J3698/7b9c7fa9071f1ad7885839ec6f3ae11e to your computer and use it in GitHub Desktop.
Save J3698/7b9c7fa9071f1ad7885839ec6f3ae11e to your computer and use it in GitHub Desktop.
def __next__(self):
if self.ilength <= 0:
raise StopIteration
self.ilength -= 1
coco_idx, wiki_idx = self.random_pair_of_indices()
content_image = self.coco[coco_idx][0]
if not self.exclude_style:
style_image = self.wiki[wiki_idx][0]
else:
style_image = None
self._check_data_to_return(style_image, content_image)
if self.exclude_style:
return content_image
else:
return content_image, style_image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment