Skip to content

Latest commit

 

History

History
executable file
·
83 lines (65 loc) · 2.77 KB

0.get_started.md

File metadata and controls

executable file
·
83 lines (65 loc) · 2.77 KB

Get Started

Installation

  1. clone this repo.

    https://github.com/XiandaGuo/OpenStereo
    
  2. Install dependenices:

    • pytorch >= 1.13.1
    • torchvision
    • timm == 0.5.4
    • pyyaml
    • tensorboard
    • opencv-python
    • tqdm
    • scikit-image

    Create a conda environment by:

    conda create -n openstereo python=3.8 
    

    Install pytorch by Anaconda:

    conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia
    

    Install other dependencies by pip:

    pip install -r requirements.txt
    

Prepare dataset

See prepare dataset.

Get trained model

Go to the model zoom, then download the model file and uncompress it to output.

Train

Train a model by Single GPU

python tools/train.py --cfg_file cfgs/igev/igev_sceneflow_amp.yaml

Multi-GPU Training on Single Node

export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
torchrun --nnodes=1 --nproc_per_node=8 --rdzv_backend=c10d --rdzv_endpoint=localhost:23456 tools/train.py --dist_mode --cfg_file cfgs/igev/igev_sceneflow_amp.yaml
  • --config The path to config file.
  • --dist_mode If specified, the program will use DDP to train.
  • your exp will saved in '/save_root_dir/DATASET_NAME/MODEL_NAME/config_file_perfix/extra_tag', save_root_dir and extra_tag can specified in train argparse

Val

Evaluate the trained model by

python tools/eval.py --cfg_file cfgs/igev/igev_sceneflow_amp.yaml --eval_data_cfg_file cfgs/sceneflow_eval.yaml --pretrained_model your_pretrained_ckpt_path

Generalization Evaluation:

python tools/eval.py --cfg_file cfgs/igev/igev_sceneflow_amp.yaml --eval_data_cfg_file cfgs/eth3d_eval.yaml --pretrained_model your_pretrained_ckpt_path
python tools/eval.py --cfg_file cfgs/igev/igev_sceneflow_amp.yaml --eval_data_cfg_file cfgs/middlebury_eval.yaml --pretrained_model your_pretrained_ckpt_path
python tools/eval.py --cfg_file cfgs/igev/igev_sceneflow_amp.yaml --eval_data_cfg_file cfgs/kitti15_eval.yaml --pretrained_model your_pretrained_ckpt_path
python tools/eval.py --cfg_file cfgs/igev/igev_sceneflow_amp.yaml --eval_data_cfg_file cfgs/kitti12_eval.yaml --pretrained_model your_pretrained_ckpt_path
  • --cfg_file The path to config file.
  • --eval_data_cfg_file The dataset config you want to eval.
  • --pretrained_model your pretrained checkpoint

Tip: Other arguments are the same as train phase.

Customize

  1. Read the detailed config to figure out the usage of needed setting items;
  2. See how to create your model;

Other

  1. You can set the default pretrained model path, by export TORCH_HOME="/path/to/pretrained_models"