Brummi / BehindTheScenes

Official implementation of the paper: Behind the Scenes: Density Fields for Single View Reconstruction (CVPR 2023)
https://fwmb.github.io/bts/
BSD 2-Clause "Simplified" License
250 stars 19 forks source link

confusion about frame_sample_mode #10

Closed rockywind closed 1 year ago

rockywind commented 1 year ago

Hi, I am confusion about the setting of frame_sample_mode.

  1. I don't know the meaning of the magical number of 4 and 2 in the code block.
  2. I don't known the meaning of this for loop
                for cam in range(4):
                    ids_loss += [cam * steps + i for i in range(start_from, steps, 2)]
                    ids_render += [cam * steps + i for i in range(1 - start_from, steps, 2)]
                    start_from = 1 - start_from
  3. When I train my dataset with only a front camera no stereo camera and fisheye camera, how can I modify these settings to fitting my dataset. image
Brummi commented 1 year ago

When training on Kitti-360, we have 4 different camera views at steps timesteps. -> 4 * steps frames. The list of frames is ordered by camera. imgs = imgs_p_left + imgs_p_right + imgs_f_left + imgs_f_right (from kitti_360_dataset.py)

To make training more stable, we partition the frames of each cameras separately. This is what happens in the four loop. frame_perm[0] is a random number in [0, nv]. -> 50% chance to be even -> start_from is randomly chosen from {0, 1}.

To train on your own dataset, you can try the "default" frame sample mode, which randomly selects n_frames_render frames from the list of frames for color sampling. The rest of the frames are used to compute the loss. Just make sure that the n_frames_render value is set adequately in the config. It should be around 50% of your total frame count.