Skip to content

Instantly share code, notes, and snippets.

@SubhadityaMukherjee
Created August 12, 2022 17:29
Show Gist options
  • Save SubhadityaMukherjee/1a30eb09e4a561910380ab224222f36d to your computer and use it in GitHub Desktop.
Save SubhadityaMukherjee/1a30eb09e4a561910380ab224222f36d to your computer and use it in GitHub Desktop.
dls
path = Path(root_dir) # base path
fields = DataBlock(
blocks=(ImageBlock, CategoryBlock),
get_items=get_image_files,
get_y=get_parent_name,
splitter=RandomSplitter(valid_pct=0.2, seed=42),
item_tfms=RandomResizedCrop(64, min_scale=0.5),
batch_tfms=aug_transforms(),
)
dls = fields.dataloaders(path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment