forked from LCAV/LenslessPiCam
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into torch_support
- Loading branch information
Showing
33 changed files
with
1,986 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ data/* | |
models/* | ||
*.png | ||
*.jpg | ||
*.npy | ||
|
||
configs/telegram_demo_secret.yaml | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
defaults: | ||
- demo | ||
- _self_ | ||
|
||
plot: True | ||
|
||
capture: | ||
exp: 5.0 | ||
awb_gains: [1, 1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
rpi: | ||
username: null | ||
hostname: null | ||
|
||
device: adafruit | ||
virtual: False | ||
save: True | ||
|
||
# pattern: data/psf/adafruit_random_pattern_20230719.npy | ||
pattern: random | ||
# pattern: rect | ||
# pattern: circ | ||
min_val: 0 # if pattern: random, min for range(0,1) | ||
rect_shape: [20, 10] # if pattern: rect | ||
radius: 20 # if pattern: circ | ||
center: [0, 0] | ||
|
||
|
||
aperture: | ||
center: [59,76] | ||
shape: [19,26] | ||
|
||
z: 4 # mask to sensor distance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# python scripts/recon/dataset.py | ||
defaults: | ||
- defaults_recon | ||
- _self_ | ||
|
||
torch: True | ||
torch_device: 'cuda:0' | ||
|
||
input: | ||
# https://drive.switch.ch/index.php/s/NdgHlcDeHVDH5ww?path=%2Fpsf | ||
psf: data/psf/adafruit_random_2mm_20231907.png | ||
# https://drive.switch.ch/index.php/s/m89D1tFEfktQueS | ||
raw_data: data/celeba_adafruit_random_2mm_20230720_1K | ||
|
||
n_files: 25 # null for all files | ||
output_folder: data/celeba_adafruit_recon | ||
|
||
# extraction region of interest | ||
roi: null # top, left, bottom, right | ||
# -- values for `data/celeba_adafruit_random_2mm_20230720_1K` | ||
# roi: [10, 300, 560, 705] # down 4 | ||
# roi: [6, 200, 373, 470] # down 6 | ||
# roi: [5, 150, 280, 352] # down 8 | ||
|
||
preprocess: | ||
flip: True | ||
downsample: 6 | ||
|
||
# to have different data shape than PSF | ||
data_dim: null | ||
# data_dim: [48, 64] # down 64 | ||
# data_dim: [506, 676] # down 6 | ||
|
||
display: | ||
disp: -1 | ||
plot: False | ||
|
||
algo: admm # "admm", "apgd", "null" to just copy over (resized) raw data | ||
|
||
apgd: | ||
n_jobs: 1 # run in parallel as algo is slow | ||
max_iter: 500 | ||
|
||
admm: | ||
n_iter: 10 | ||
|
||
save: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# python scripts/sim/digicam_psf.py | ||
hydra: | ||
job: | ||
chdir: True # change to output folder | ||
|
||
use_torch: False | ||
dtype: float32 | ||
torch_device: cuda | ||
requires_grad: True | ||
|
||
digicam: | ||
|
||
slm: adafruit | ||
sensor: rpi_hq | ||
|
||
# https://drive.switch.ch/index.php/s/NdgHlcDeHVDH5ww?path=%2Fpsf | ||
pattern: data/psf/adafruit_random_pattern_20230719.npy | ||
ap_center: [59, 76] | ||
ap_shape: [19, 26] | ||
rotate: -0.8 # rotation in degrees | ||
|
||
# optionally provide measured PSF for side-by-side comparison | ||
# https://drive.switch.ch/index.php/s/NdgHlcDeHVDH5ww?path=%2Fpsf | ||
psf: data/psf/adafruit_random_2mm_20231907.png | ||
gamma: 2 # for plotting measured | ||
|
||
sim: | ||
|
||
# whether SLM is fliped | ||
flipud: True | ||
|
||
# in practice found waveprop=True or False doesn't make difference | ||
waveprop: False | ||
|
||
# below are ignored if waveprop=False | ||
scene2mask: 0.03 # [m] | ||
mask2sensor: 0.002 # [m] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
hydra: | ||
job: | ||
chdir: True # change to output folder | ||
|
||
seed: 0 | ||
|
||
data: | ||
# -- path to original CelebA (parent directory) | ||
original: /scratch/bezzam | ||
|
||
output_dir: "./vit-celeba" # basename for model output | ||
|
||
# -- raw | ||
# https://drive.switch.ch/index.php/s/m89D1tFEfktQueS | ||
measured: data/celeba_adafruit_random_2mm_20230720_10K | ||
raw: True | ||
|
||
# # -- reconstructed | ||
# # run `python scripts/recon/dataset.py` to get a reconstructed dataset | ||
# measured: null | ||
# raw: False | ||
|
||
n_files: null # null to use all in measured_folder | ||
test_size: 0.15 | ||
attr: Male # "Male", "Smiling", etc | ||
|
||
augmentation: | ||
|
||
random_resize_crop: False | ||
horizontal_flip: True # cannot be used with raw measurement! | ||
|
||
train: | ||
|
||
prev: null # path to previously trained model | ||
n_epochs: 4 | ||
dropout: 0.1 | ||
batch_size: 16 | ||
learning_rate: 2e-4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
slm_controller @ git+https://github.com/ebezzam/slm-controller.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.