问题如下:
parser.add_argument("--output", nargs='?', type=str, default="",help = "[Optional] Video output path")parser.add_argument('--image', default=False, action="store_true",help='Image detection mode, will ignore all positional arguments')
查询结果
nargs='*' 表示参数个数可以为0个或者n个(n等于1,2,3...)
nargs=' '+' 表示参数个数为一个或多个,不能是0个
nargs='?' 表示参数个数为0个或者一个store_true: 如果给了这个参数,将其值标记为True,没给就为False
store_false 相反