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.