@@ -0,0 +1,2095 @@
+# This script accompanies Kaggle's Computer Vision course.%0A%0A# Imports%0Aimport os%0Aimport warnings%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0Afrom matplotlib import gridspec%0Aimport visiontools%0Afrom visiontools import StanfordCars%0Aimport tensorflow as tf%0Aimport tensorflow_datasets as tfds%0A%0A%0A# Ensure reproducibility%0Adef set_seed(seed=31415):%0A    np.random.seed(seed)%0A    tf.random.set_seed(seed)%0A    os.environ%5B'PYTHONHASHSEED'%5D = str(seed)%0A    os.environ%5B'TF_DETERMINISTIC_OPS'%5D = '1'%0A%0Aseed = 31415%0Aset_seed(seed)%0A%0A%0A# Set Matplotlib defaults%0Aplt.rc('figure', autolayout=True)%0Aplt.rc('axes', labelweight='bold', labelsize='large',%0A       titleweight='bold', titlesize=18, titlepad=10)%0Aplt.rc('image', cmap='magma')%0Awarnings.filterwarnings(%22ignore%22) # to clean up output cells%0A%0A%0A# Load training and validation sets%0ADATA_DIR = '/kaggle/input/stanford-cars-for-learn/'%0Aread_config = tfds.ReadConfig(shuffle_seed=seed)%0A%0A(ds_train_, ds_valid_), ds_info = tfds.load(%0A    'stanford_cars/simple',%0A    split=%5B'train', 'test'%5D,%0A    shuffle_files=True,%0A    with_info=True,%0A    data_dir=DATA_DIR,%0A    read_config=read_config,%0A)%0Aprint((%22Loaded %7B%7D training examples %22 +%0A       %22and %7B%7D validation examples %22 +%0A       %22with classes %7B%7D.%22).format(%0A           ds_info.splits%5B'train'%5D.num_examples,%0A           ds_info.splits%5B'test'%5D.num_examples,%0A           ds_info.features%5B'label'%5D.names))%0A%0A%0A# Create data pipeline%0ABATCH_SIZE = 16%0AAUTO = tf.data.experimental.AUTOTUNE%0ASIZE = %5B192, 192%5D%0Apreprocess = visiontools.make_preprocessor(size=SIZE)%0A%0Ads_train = (ds_train_%0A            .map(preprocess)%0A            .cache()%0A            .shuffle(ds_info.splits%5B'train'%5D.num_examples)%0A            .batch(BATCH_SIZE)%0A            .prefetch(AUTO))%0A%0Ads_valid = (ds_valid_%0A            .map(preprocess)%0A            .cache()%0A            .shuffle(ds_info.splits%5B'test'%5D.num_examples)             %0A            .batch(BATCH_SIZE)%0A            .prefetch(AUTO))%0Aprint((%22Created training pipeline as %60ds_train%60.%5Cn%22+%0A       %22Created validation pipline as %60ds_valid%60.%5Cn%22%0A       %22Batch Size: %7B%7D  Image Size: %7B%7D%22.format(BATCH_SIZE, SIZE)))

Add cv-prelude