Skip to content

Instantly share code, notes, and snippets.

@anand086
Created July 6, 2021 06:36
Show Gist options
  • Save anand086/5e52d15d909624eb047b8535aab1811f to your computer and use it in GitHub Desktop.
Save anand086/5e52d15d909624eb047b8535aab1811f to your computer and use it in GitHub Desktop.
path = untar_data(URLs.CAMVID_TINY)
dls = SegmentationDataLoaders.from_label_func(
path, bs=8, fnames = get_image_files(path/"images"),
label_func = lambda o: path/'labels'/f'{o.stem}_P{o.suffix}',
codes = np.loadtxt(path/'codes.txt', dtype=str)
)
learn = unet_learner(dls, resnet34)
learn.fine_tune(8)
learn.show_results(max_n=6, figsize=(20,20))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment