整個flow及data 都很完整. 很有誠意的source code, 遇到的問題不多. 很適合入門的例子. 可以使用YOLOV7 的安裝方式 + monodepth2, 不夠的再補安裝缺少的套件

1. 主網頁:

   https://github.com/JiawangBian/sc_depth_pl

2. download [dataset] 主頁dataset 中有提供連結

[kitti_raw] [nyu]

解壓到 ./datasets/kitti and ./datasets/nyu

3. download chkpoint 主頁 pre-trained models 中有提供連結

[kitti_scv1_model]

[nyu_scv2_model]:

4.  測試 inference

python inference.py --config configs/v1/kitti_raw.txt --input_dir demo/input/ --output_dir demo/output/ --ckpt_path ckpts/kitti_scv1/version_0/epoch=99-val_loss=0.1411.ckpt --save-vis --save-depth
D:\depth\sc_depth_pl-master\ckpts\kitti_scv1\version_0

 

input images

  D:\depth\sc_depth_pl-master\demo\input

output files

  D:\depth\sc_depth_pl-master\demo\output\model_v2\vis

  D:\depth\sc_depth_pl-master\demo\output\model_v2\depth

5. 測試 training 

python train.py --config configs/v2/nyu.txt --dataset_dir datasets/nyu

  開始有錯誤訊息:

補安裝

pip install path.py

python -m pip install ConfigArgparse

pip install test-tube

退版號 1.6.5

pip install pytorch-lightning==1.6.5

 

### 版本問題: 請照原官網中的建議版本安裝 (Install 章節). 也許問題會少一些

6. runtime error.

distributed_backend,  將source 此行mark 掉

    trainer = Trainer(max_epochs=hparams.num_epochs,
                      limit_train_batches=hparams.epoch_size,
                      num_sanity_val_steps=5,
                      callbacks=[checkpoint_callback],
                      logger=logger,
                      weights_summary=None,
                      progress_bar_refresh_rate=1,
                      gpus=hparams.num_gpus,
#                      distributed_backend='ddp' if hparams.num_gpus > 1 else None,
                      benchmark=True
                      )

7. output ckpt 放在 .\sc_depth_pl-master\ckpts\nyu_scv2 

 

8. 測試 training 後的 weight file 

python inference.py --config configs/v2/nyu.txt --input_dir demo/input/ --output_dir demo/output/ --ckpt_path ckpts/nyu_scv2/version_15/epoch=12-val_loss=0.1997.ckpt --save-vis --save-depth

在ckpt 目錄中找到產出的, ckpt

 

文章標籤
全站熱搜
創作者介紹
創作者 cianfen 的頭像
cianfen

cianfen的部落格

cianfen 發表在 痞客邦 留言(0) 人氣(21)