Skip to content

Commit

Permalink
Add HITL configuration. (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzam authored Jan 9, 2024
1 parent 8e3747b commit 07f533f
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 1 deletion.
1 change: 0 additions & 1 deletion configs/train_celeba_digicam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ files:
celeba_root: /scratch/bezzam

test_idx: [0, 1, 2, 3, 4]
# test_idx: [1000, 2000, 3000, 4000]

# for prepping ground truth data
simulation:
Expand Down
111 changes: 111 additions & 0 deletions configs/train_celeba_digicam_hitl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Learn mask with HITL training by setting measure configuration (set to null for learning in simulation)
#
# EXAMPLE COMMAND:
# python scripts/recon/train_unrolled.py -cn train_celeba_digicam_hitl measure.rpi_username=USERNAME measure.rpi_hostname=HOSTNAME files.vertical_shift=SHIFT

defaults:
- train_celeba_digicam
- _self_

# Train Dataset
files:

dataset: CelebA
celeba_root: /scratch/bezzam
n_files: 1000

downsample: 8
# TODO: set appropriately to align
vertical_shift: -520
horizontal_shift: null
crop:
vertical: [0, 2000]
horizontal: [1200, 2800]

measure:
# TODO: set for device
rpi_username: null
rpi_hostname: null

display:
# default to this screen: https://www.dell.com/en-us/work/shop/dell-ultrasharp-usb-c-hub-monitor-u2421e/apd/210-axmg/monitors-monitor-accessories#techspecs_section
screen_res: [1920, 1200] # width, height
pad: 10
hshift: 0
vshift: -18
brightness: 100
rot90: 3

capture:

# NB: not being used
max_level: 254
min_level: 150
max_tries: 4
delay: 2

sensor: rpi_hq
gamma: null # for visualization
exp: 0.8
script: ~/LenslessPiCam/scripts/measure/on_device_capture.py
iso: 100
config_pause: 1
sensor_mode: "0"
nbits_out: 8
nbits_capture: 12
legacy: True
gray: False
fn: raw_data
bayer: True
awb_gains: [1.6, 1.2]
rgb: True
down: 8
flip: True


# for prepping ground truth data
simulation:
scene2mask: 0.3 # [m]
mask2sensor: 0.002 # [m]
object_height: 0.38 # [m]
snr_db: 5
downsample: null
random_vflip: False
random_hflip: False
quantize: False
flip: False

#Training
training:
batch_size: 4
epoch: 10
eval_batch_size: 1
crop_preloss: True
save_every: 1

#Trainable Mask
trainable_mask:
mask_type: AdafruitLCD #Null or "TrainablePSF" or "AdafruitLCD"
# "random" (with shape of config.files.psf) or path to npy file
grayscale: False
mask_lr: 1e-3
L1_strength: False
min_val: 0

train_mask_vals: True
train_color_filter: True

# -- only for AdafruitLCD
initial_value: data/psf/adafruit_random_pattern_20231107_150902.npy
ap_center: [57, 77]
ap_shape: [18, 26]
rotate: 0 # rotation in degrees
# to align with measured PSF (so reconstruction also aligned)
vertical_shift: 0 # [px]
horizontal_shift: 0 # [px]

slm: adafruit
sensor: rpi_hq
flipud: True
waveprop: True # TODO: remove if too slow

Binary file not shown.

0 comments on commit 07f533f

Please sign in to comment.