Skip to content

Instantly share code, notes, and snippets.

@J3698
Last active June 27, 2021 18:00
Show Gist options
  • Save J3698/fa16569397dfbdc5e75c9fc2b370bf2f to your computer and use it in GitHub Desktop.
Save J3698/fa16569397dfbdc5e75c9fc2b370bf2f to your computer and use it in GitHub Desktop.
class IterableStyleTransferDataset(IterableDataset):
def __init__(self, coco_path, coco_annotations, \
wiki_path, length = 100000, transform = None, rng_seed = 1, exclude_style = False):
self.wiki = ImageFolder(wiki_path, transform = transform)
self.coco = CocoCaptions(coco_path, coco_annotations, transform = transform)
self.length = length
self.exclude_style = exclude_style
self.seed = rng_seed
self.random = random.Random(rng_seed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment