Skip to content

Latest commit

 

History

History

2022_ISTE

Single-pixel reconstruction (ISTE 2021)

We provide the code that produces the results that we report in

Nicolas Ducros. Book title. Chapter Title. 2022 ⟨doi⟩. Download PDF.

Contact: [email protected], CREATIS Laboratory, University of Lyon, France.

Running the scripts

  • Install SPyRiT and all dependencies. On Windows, you need first to install torch first (see the SPyRiT installation guide).
	pip install -e spyrit .

NB: The scripts were tested with the commit 0035901.

  • Launch Spyder from the current folder
spyder

and run main_*.py.

STL-10 database

[optional] If you already have the STL-10 dataset on your computer, create a symbolic link. Otherwise the STL-10 dataset will be downloaded.

  • Linux:
ln -s <stl-10 parent folder> /data/ 
  • Windows Powershell:
New-Item -ItemType SymbolicLink -Name \data\ -Target <stl-10 parent folder>

Covariance matrix

Most of the scripts require a covariance matrix and mean image

from spyrit.misc.statistics import stat_walsh_stl10
stat_walsh_stl10()

Trained networks (not tested yet)

You can download the networks from this url.

We also provide train.py to train the different variants of the network, from a single command line.

  1. Completion network

    python train.py
  2. Pseudo inverse network

    python train.py --net_arch 2
  3. Free network

    python train.py --net_arch 3

Note that

  • the models are saved in the default folder .\models\. To save them at another location consider
python train.py --model_root myfolder
  • The defaults training parameters can be changed. For instance, run
python train.py --num_epochs 10 --batch_size 512 --lr 1e-8

to train your network for 10 epochs, with a batch size of 512, and a learning rate of 1e-8.

  • you can keep Average_64x64.npy, Cov_64x64.npy and Var_64x64.npy in .\stats\, to avoid re-computing them, which can be time-consuming.