Last active
May 3, 2020 17:22
-
-
Save Blaizzy/3ca30dbb7ec0323b77eb646f4d536ae4 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
| scale, bs = 2, 8 | |
| # scale, bs = 4, 4 | |
| sz_lr = 256 | |
| src = ImageImageList.from_folder(path).split_by_rand_pct(0.1, seed = 42) | |
| def get_data(bs, size): | |
| data = (src.label_from_func(lambda x: path/x.name) | |
| .transform(get_transforms(do_flip=True, max_rotate=20), | |
| size=size[0],tfm_y =True) | |
| .transform_y(size = size[1]) | |
| .databunch(bs=bs, no_check = True).normalize(imagenet_stats, do_y=True)) | |
| return data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment