bts代码复现

1.Prepare NYU Depth V2 test set:

795 training images
654 test images

图片存放路径:../../dataset/nyu_depth_v2/official_splits/

2.下载网络模型:

选用DenseNet121 可以在cpu上训练

添加语句device = torch.device("cuda" if torch.cuda.is_available() else "cpu")并且把cuda()改写为to(device)

Note: Modify arguments '--encoder', '--model_name', '--checkpoint_path' and '--pred_path' accordingly.

3.Live Demo

python bts_live_3d.py 
--model_name bts_nyu_v2_pytorch_densenet121 
--encoder densenet121_bts 
--checkpoint_path ./models/bts_nyu_v2_pytorch_densenet121/model 
--max_depth 10 
--input_height 480 
--input_width 640

4.Testing with NYU Depth V2

python bts_test.py arguments_test_nyu.txt

This will save results to ./result_bts_nyu_v2_pytorch_densenet121. 

5.Evaluation

python ../utils/eval_with_pngs.py 
--pred_path result_bts_nyu_v2_pytorch_densenet161/raw/
--gt_path ../../dataset/nyu_depth_v2/official_splits/test/
--dataset nyu 
--min_depth_eval 1e-3 
--max_depth_eval 10 
--eigen_crop

You should see outputs like this:

Raw png files reading done
Evaluating 654 files
GT files reading done
0 GT files missing
Computing errors
     d1,      d2,      d3,  AbsRel,   SqRel,    RMSE, RMSElog,   SILog,   log10
  0.885,   0.978,   0.994,   0.110,   0.066,   0.392,   0.142,  11.533,   0.047
Done.

6.Preparation for Training

python utils/download_from_gdrive.py 1AysroWpfISmm-yRFGBgFTrLy6FjQwvwP ../dataset/nyu_depth_v2/sync.zip

unzip sync.zip

Once the dataset is ready, you can train the network using following command.

python bts_main.py arguments_train_nyu.txt

You can check the training using tensorboard:

tensorboard --logdir ./models/bts_nyu_test/ --port 6006

Open localhost:6006 with your favorite browser to see the progress of training.

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值