Last active
June 27, 2021 18:15
-
-
Save J3698/7b9c7fa9071f1ad7885839ec6f3ae11e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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