# @package _global_

dataset: 'devreals'

cam:
  H: 480 
  W: 640
  fx: 605.959594
  fy: 606.152771
  cx: 320.390350
  cy: 239.96978
  png_depth_scale: 1000.
  crop_edge: 10
  near: 0
  far: 5
  depth_trunc: 5

davis:
  H: 260
  W: 346
  fx: 301.761002562036
  fy: 302.015215497770
  cx: 165.741885625889
  cy: 132.055209456854
  distortion: [-0.381786036357427, 0.156027148464039, 0.0, 0.0]

cam2davis:
  [0.99996855, 0.00015794, -0.00792945, -0.00102357,
    -0.00023467, 0.99995315, -0.00967656, -0.01221866,
    0.00792755, 0.00967812, 0.99992174, -0.01120438,
    0.0, 0.0, 0.0, 1.0]

adsampler:
  enable_tracking: True
  enable_mapping: True
  h: 32
  w: 32
  h_evcam: 32
  w_evcam: 32
  pad_ratio: 0.

data:
  downsample: 1
  sc_factor: 1
  translation: 0
  num_workers: 4

mapping:
  sample: 2048
  first_mesh: True
  iters: 10
  cur_frame_iters: 0
  lr_embed: 0.01
  lr_decoder: 0.01
  lr_rot: 0.001
  lr_trans: 0.001
  keyframe_every: 5
  map_every: 5
  n_pixels: 0.05
  first_iters: 200
  optim_cur: True
  min_pixels_cur: 100
  map_accum_step: 1
  pose_accum_step: 5
  map_wait_step: 0
  filter_depth: False

  # TODO: Ablation
  second_mesh: True
  second_mapping: True
  use_ev: True

tracking:
  iters: 10
  sample: 1024
  pc_samples: 40960
  lr_rot: 0.001
  lr_trans: 0.001
  ignore_edge_W: 20
  ignore_edge_H: 20
  iter_point: 0
  wait_iters: 100
  const_speed: True
  best: True
  # TODO: Ablation
  use_ev: True

grid:
  enc: 'HashGrid'
  tcnn_encoding: True
  hash_size: 16
  voxel_color: 0.08
  voxel_sdf: 0.02
  oneGrid: True

pos:
  enc: 'OneBlob'
  n_bins: 16

decoder:
  geo_feat_dim: 15
  hidden_dim: 32
  num_layers: 2
  num_layers_color: 2
  hidden_dim_color: 32
  tcnn_network: False
  
  hidden_dim_rgb_crf: 16
  num_layers_rgb_crf: 2      
  hidden_dim_event_crf: 16
  num_layers_event_crf: 2
  exposure_rgb: 1.0
  exposure_event: 1.0

training:
  rgb_weight: 5.0
  depth_weight: 0.1
  sdf_weight: 1000
  fs_weight: 10
  eikonal_weight: 0
  smooth_weight: 0.000001
  smooth_pts: 32
  smooth_vox: 0.1
  smooth_margin: 0.05
  n_samples: 16
  n_samples_d: 32
  range_d: 0.1
  n_range_d: 11
  n_importance: 0
  perturb: 1
  white_bkgd: False
  trunc: 0.1
  rot_rep: 'axis_angle'
  rgb_missing: 0.05

  ev_weight: 0.01
  ev_missing: 0.005 # * update from 0.05 to 0.005
  unit_exposure_rgb: 0.5
  rgbexps_weight: 0.1
  unit_exposure_event: 0.5
  exposure_weight_rgb: 0.1
  # TODO: Ablation
  use_crf: True


mesh:
  resolution: 512
  render_color: False
  vis: 5000
  voxel_eval: 0.05
  voxel_final: 0.02
  visualisation: False
  
debug:
  show_loss: False