1先看一下readme
一些来源如下:
[Clément Godard](http://www0.cs.ucl.ac.uk/staff/C.Godard/), [Oisin Mac Aodha](http://vision.caltech.edu/~macaodha/), [Michael Firman](http://www.michaelfirman.co.uk) and [Gabriel J. Brostow](http://www0.cs.ucl.ac.uk/staff/g.brostow/)
> [ICCV 2019 (arXiv pdf)](https://arxiv.org/abs/1806.01260)
本机环境:ubuntu20.04,pytorch=1.7.1,torchvision=0.8.0a0,cv2=3.4.2,cuda.avaliable()=0
##预测但张图像的深度,test_simple.py
就这三部分,县来看parse_args函数。
import argparse #导入argparse模块
def parse_args():#定义函数
parser = argparse.ArgumentParser(
description='Simple testing funtion for Monodepthv2 models.')
#创建ArgmentParser对象,该对象包含将命令行解析成python数据类型的一些信息。
parser.add_argument('--image_path', type=str,
help='path to a test image or folder of images', required=True)
#调用add_argument()方法添加参数,调用将指定argumenparser如何获取命令行字符并将其转换为对象。
parser.add_argument('--model_name', type=str,
help='name of a pretrained model to use',
choices=[
"mono_640x192",
"stereo_640x192",
"mono+stereo_640x192",
"mono_no_pt_640x192",
"stereo_no_pt_640x192",
"mono+stereo_no_pt_640x192",