- Ensure that the Unsplash Lite dataset is downloaded and saved as
../unsplash-lite. - Ensure that
uvis installed.
- Filter the dataset to use only a small subset of images: Create a new list of images that will be stored in
tmp/train_photos.csvandtmp/test_photos.csv.uv run filter_dataset.py
- Download the images: Download all the images listed in
tmp/train_photos.csvandtmp/test_photos.csvto<working_directory>/trainand<working_directory>/testrespectively and filter out any images that failed to download.uv run download_images.py <working_directory>
uv run dataset_analysis.py <working_directory>generates a plot of the distribution of images by dimensions.
uv run train_srcnn.py <working_directory> <start_epoch>start_epoch is 1 by default. This trains and validates the model for upto 100 epochs. For each epoch, after validation, the training and validation loss along with the states of the model, optimizer and scheduler are saved to tmp/models/model_<epoch>.tar. If start_epoch is not 1, the model from the previous epoch will be loaded by accessing tmp/models/model_<start_epoch-1>.tar.
uv run test_srcnn.py <working_directory>This computes the average PSNR and SSIM over the test dataset at all epochs for which a tmp/models/model_<epoch>.tar exists.
uv run interpret_training.pyThis reads the losses from tmp/models/model_<epoch>.tar.
uv run interpret_test.py <working_directory>This reads the PSNR and SSIM from tmp/models/model_<epoch>.tar and plots them against the epoch number.
uv run get_filters.py <epoch>This loads the model from tmp/models/model_<epoch>.tar and renders the filters as a grid in a grayscale image.