For my final year project for UCL Computer Science, I investigated the use of processes from diffusion models for image reconstruction of lensless cameras, using the DiffuserCam data set.
The dataset can be found through this link: DiffuserCam Dataset
For all commands, the path to the dataset will be "path_to_dataset"
Using the environment.yml
file, you can run
conda env create -f environment.yml
Or manually install the necessary using the commands below
conda create -n lensless-diffusion pytorch torchvision pytorch-cuda=11.7 -c pytorch -c nvidia
conda activate lensless-diffusion
pip install tqdm einops piq odak
Models for the saved_models
directory can be found through this link: Pretrained Models
By default, all models are selected if the flag is ommitted. You can select one model by adding the flag --models
and its name, e.g.
--models "residual_diffusion_model_x0"
python main.py --dataset "path_to_dataset" --sample --models "residual_diffusion_model_x0"
python main.py --dataset "path_to_dataset" --itw --models "residual_diffusion_model_x0"
python main.py --dataset "path_to_dataset" --train --models "residual_diffusion_model_x0"
Note: This will only return results if reconstructed images exist in the relevant directory
python main.py --dataset "path_to_dataset" --results --models "residual_diffusion_model_x0"