Learning how quarto works with jupyter notebooks. This is a sample editted notebook from fastai.
from fastai.vision.allimport*chosen_sample_seed =42chosen_sample_n =5
c:\Users\tonyp\miniconda3\envs\fastai\Lib\site-packages\torchvision\io\image.py:13: UserWarning: Failed to load image Python extension: '[WinError 127] The specified procedure could not be found'If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
warn(
# 0. get paths of imagespath_dir_obj = untar_data(URLs.MNIST_TINY)list_all_img_path_obj = get_image_files(path_dir_obj)
# 1. create learnerdata_loader = ImageDataLoaders.from_folder(path_dir_obj, img_cls=PILImageBW, set_seed=42)x1,y1 = data_loader.one_batch()test_eq(x1.shape, [64, 1, 28, 28])print_useful_info()print_sample_imgs()# check valid data sets - can check if splits are as expectedprint(len(data_loader.valid_ds.items)) # 699 as expectedprint(len(data_loader.train_ds.items)) # 709 as expected# can show sample picsdata_loader.show_batch() #show examples?