facebookresearch / DistDepth

Repository for "Toward Practical Monocular Indoor Depth Estimation" (CVPR 2022)
Other
216 stars 20 forks source link

Problem by training on own dataset #22

Closed Jaisme closed 1 year ago

Jaisme commented 1 year ago

Thanks a lot for the nice work! I am quite new to this field of depth estimation and would like to train this model on our own dataset (obtained from small space with about 0-20cm depth).

What I have done til now:

  1. Generated my own dataset class
  2. Started a test training with following parameters (without datapath etc.)
    --batch_size
    2
    --num_workers
    8
    --width
    960
    --height
    512
    --max_depth
    20.0
    --num_epochs
    5
    --scheduler_step_size
    8
    --learning_rate
    0.0001
    --thre
    0.95
    --num_layers
    18

    I adapted some code for the training, such as the line 41 self.num_pose_frames = 2 # self.num_input_frames in the execute_func.py, since the pose network is implemented only for two pose frames so far.

However, unfortunately I got another error AttributeError: 'Trainer' object has no attribute 'matching_ids' in the function predict_poses (about line 897) also in execute_func.py. Does anyone know how to resolve this error?

Furthermore, I have some questions about training:

  1. is it possible to train this model with monocular images like ManyDepth?
  2. which hyperparameters do I need to adjust for our own dataset?

I really appreciate for any help. Please let me know if you need more information :)

choyingw commented 1 year ago

The matching_ids issue is a collision feature for test-time single/multiframe mode. I will try to fix it next week. The easy way should be comment out https://github.com/facebookresearch/DistDepth/blob/8e45d570ae4771692c57baeb2c7cb5ee24f90b6b/execute_func.py#L887 to https://github.com/facebookresearch/DistDepth/blob/8e45d570ae4771692c57baeb2c7cb5ee24f90b6b/execute_func.py#L918 and see if that works.

(1) Yes, in paper, we also show training on ManyDepth. The easiest way is to build on ManyDepth's code and add distillation loss, which is what We've done in the paper. We'll consider releasing the part of the training code later.

(2) the input resolution might affect the results; larger resolution might give more high-frequency details but more local receptive fields. The num_layers=18 might be too small to learn a good depth map

choyingw commented 1 year ago

I have updated more instructions for how to train on your own dataset. Please check the README if interested!

Jaisme commented 1 year ago

Thanks for your reply! I'll definitely try it :D