|
| 1 | +# Co-SLAM Documentation |
| 2 | + |
| 3 | +### [Paper](https://arxiv.org/pdf/2304.14377.pdf) | [Project Page](https://hengyiwang.github.io/projects/CoSLAM) | [Video](https://hengyiwang.github.io/projects/Co-SLAM/videos/presentation.mp4) |
| 4 | + |
| 5 | +> Co-SLAM: Joint Coordinate and Sparse Parametric Encodings for Neural Real-Time SLAM <br /> |
| 6 | +> [Hengyi Wang](https://hengyiwang.github.io/), [Jingwen Wang](https://jingwenwang95.github.io/), [Lourdes Agapito](http://www0.cs.ucl.ac.uk/staff/L.Agapito/)<br /> |
| 7 | +> CVPR 2023 |
| 8 | +
|
| 9 | +This is the documentation for Co-SLAM that contains data capture, details of different hyper-parameters. |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## Create your own dataset using iphone/ipad pro |
| 14 | + |
| 15 | +1. Download [strayscanner](https://apps.apple.com/us/app/stray-scanner/id1557051662) in App Store |
| 16 | +2. Record the RGB-D video |
| 17 | +3. The output fold should be at `Files/On My iPad/Stray Scanner/` |
| 18 | +4. Create your own config files for dataset, set `dataset: 'iphone'` , check `./configs/iPhone` for details. (Note intrinsics given by Stray Scanner should be divided by 7.5 to align the RGB-D frame) |
| 19 | +5. Create your config file for specific scene, you can define the scene bound yourself, or use provided `vis_bound.ipynb` to determine scene bound |
| 20 | + |
| 21 | +NOTE: The resolution of depth map is (256, 192), which is a bit too small. The camera tracking of neural SLAM won't be very robust on the iphone dataset. It is recommended to use RealSense for data capturing. Any suggestions on this would be welcome. |
| 22 | + |
| 23 | +## Parameters |
| 24 | + |
| 25 | +### Tracking |
| 26 | + |
| 27 | +```python |
| 28 | +iter: 10 # num of iterations for tracking |
| 29 | +sample: 1024 # num of samples for tracking |
| 30 | +pc_samples: 40960 # num of samples for tracking using pc loss (Not used) |
| 31 | +lr_rot: 0.001 # lr for rotation |
| 32 | +lr_trans: 0.001 # lr for translation |
| 33 | +ignore_edge_W: 20 # ignore the edge of image (W) |
| 34 | +ignore_edge_H: 20 # ignore the edge of image (H) |
| 35 | +iter_point: 0 # num of iterations for tracking using pc loss (Not used) |
| 36 | +wait_iters: 100 # Stop optimizing if no improvement for k iterations |
| 37 | +const_speed: True # Constant speed assumption for initializing pose |
| 38 | +best: True # Use the pose with smallest loss/Use last pose |
| 39 | +``` |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +### Mapping |
| 44 | + |
| 45 | +```python |
| 46 | +sample: 2048 # Number of pixels used for BA |
| 47 | +first_mesh: True # Save first mesh |
| 48 | +iters: 10 # num of iterations for BA |
| 49 | + |
| 50 | +# lr for representation, an interesting observation is that |
| 51 | +# if you set lr_embed=0.001, lr_decoder=0.01, this makes |
| 52 | +# decoder relies more on coordinate encoding, results in |
| 53 | +# better completion. This is suitable for room-scale scene, but |
| 54 | +# is not suitable for TUM RGB-D... |
| 55 | +lr_embed: 0.01 # lr for HashGrid |
| 56 | +lr_decoder: 0.01 # lr for decoder |
| 57 | + |
| 58 | +lr_rot: 0.001 # lr for rotation |
| 59 | +lr_trans: 0.001 # lr for translation |
| 60 | +keyframe_every: 5 # Select keyframe every 5 frames |
| 61 | +map_every: 5 # Perform BA every 5 frames |
| 62 | +n_pixels: 0.05 # num of pixels saved for each frame |
| 63 | +first_iters: 500 # num of iterations for first frame mapping |
| 64 | + |
| 65 | +# As we perform global BA, we need to make sure 1) for every |
| 66 | +# iteration, there should be samples from current frame, and |
| 67 | +# 2) Do not sample too many pixels on current frame, which may |
| 68 | +# introduce bias, it is suggested min_pixels_cur = 0.01 * #samples |
| 69 | +optim_cur: False # For challenging scenes, avoid optimizing current frame pose during BA |
| 70 | +min_pixels_cur: 20 # min pixels sampled for current frame |
| 71 | +map_accum_step: 1 # num of steps for accumulating gradient for model |
| 72 | +pose_accum_step: 5 # num of steps for accumulating gradient for pose |
| 73 | +map_wait_step: 0 # wait n iterations to start update model |
| 74 | +filter_depth: False # Filter out outliers or not |
| 75 | +``` |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +### Parametric encoding |
| 80 | + |
| 81 | +```python |
| 82 | +enc: 'HashGrid' # Type of grid, including 'DenseGrid, TiledGrid' as describled in tinycudann |
| 83 | +tcnn_encoding: True # Use tcnn encoding |
| 84 | +hash_size: 19 # Hash table size, refer to our paper for different settings of each dataset |
| 85 | +voxel_color: 0.08 # Voxel size for color grid (if applicable) |
| 86 | +voxel_sdf: 0.04 # Voxel size for sdf grid (Larger than 10 means voxel dim instead, i.e. fixed resolution) |
| 87 | +oneGrid: True # Use only OneGrid |
| 88 | +``` |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +### Coordinate encoding |
| 93 | + |
| 94 | +```python |
| 95 | +enc: 'OneBlob' # Type of coordinate encoding |
| 96 | +n_bins: 16 # Number of bins for OneBlob |
| 97 | +``` |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | +### Decoder |
| 102 | + |
| 103 | +```python |
| 104 | +geo_feat_dim: 15 # Dim of geometric feature for color decoder |
| 105 | +hidden_dim: 32 # Dim of SDF MLPs |
| 106 | +num_layers: 2 # Num of layers for SDF MLP |
| 107 | +num_layers_color: 2 # Num of layers for color MLPs |
| 108 | +hidden_dim_color: 32 # Dim of color MLPs |
| 109 | +tcnn_network: False # Use tinycudann MLP or Pytorch MLP |
| 110 | +``` |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | +### Training |
| 115 | + |
| 116 | +```python |
| 117 | +rgb_weight: 5.0 # weight of rgb loss |
| 118 | +depth_weight: 0.1 # weight of depth loss |
| 119 | +sdf_weight: 1000 # weight of sdf loss (truncation) |
| 120 | +fs_weight: 10 # weight of sdf loss (free space) |
| 121 | +eikonal_weight: 0 # weight of eikonal (Not used) |
| 122 | +smooth_weight: 0.001 # weight of smoothness loss (Smaller, as it is applied for feature) |
| 123 | +smooth_pts: 64 # Dim of random sampled grid for smoothness |
| 124 | +smooth_vox: 0.1 # Voxel size of random sampled grid for smoothness |
| 125 | +smooth_margin: 0.05 # Margin of sampled grid |
| 126 | +#n_samples: 256 |
| 127 | +n_samples_d: 96 # Num of sample points for rendering |
| 128 | +range_d: 0.25 # Sampled range for depth-guided sampling [-25cm, 25cm] |
| 129 | +n_range_d: 21 # Num of depth-guided sample points |
| 130 | +n_importance: 0 # Num of sample points for importance sampling |
| 131 | +perturb: 1 # Random perturbation (1:True) |
| 132 | +white_bkgd: False |
| 133 | +trunc: 0.1 # truncation range (10cm for room-scale scene, 5cm for RUM RGBD) |
| 134 | +rot_rep: 'quat' # Rotation representation. (Axis angle does not support identity init) |
| 135 | +``` |
| 136 | + |
0 commit comments