传入无效参数时(python detect.py a b c),则会报错,同时会提示应该如何输入命令行:
(base) F:\WORK\Python_Work\yolov3-master>python detect.py a b c
usage: detect.py [-h][--weights WEIGHTS [WEIGHTS ...]][--source SOURCE][--img-size IMG_SIZE][--conf-thres CONF_THRES][--iou-thres IOU_THRES][--device DEVICE][--view-img][--save-txt][--save-conf][--nosave][--classes CLASSES [CLASSES ...]][--agnostic-nms][--augment][--update][--project PROJECT][--name NAME][--exist-ok]
detect.py: error: unrecognized arguments: a b c
输入 -h提示帮助信息(python detect.py -h),输出可选参数的格式:
(base) F:\WORK\Python_Work\yolov3-master>python detect.py -h
usage: detect.py [-h][--weights WEIGHTS [WEIGHTS ...]][--source SOURCE][--img-size IMG_SIZE][--conf-thres CONF_THRES][--iou-thres IOU_THRES][--device DEVICE][--view-img][--save-txt][--save-conf][--nosave][--classes CLASSES [CLASSES ...]][--agnostic-nms][--augment][--update][--project PROJECT][--name NAME][--exist-ok]
optional arguments:-h,--help show this help message and exit
--weights WEIGHTS [WEIGHTS ...]
model.pt path(s)--source SOURCE source
--img-size IMG_SIZE inference size (pixels)--conf-thres CONF_THRES
object confidence threshold
--iou-thres IOU_THRES
IOU threshold for NMS
--device DEVICE cuda device, i.e.0or0,1,2,3or cpu
--view-img display results
--save-txt save results to *.txt
--save-conf save confidences in--save-txt labels
--nosave do not save images/videos
--classes CLASSES [CLASSES ...]filter by class:--class0,or--class023--agnostic-nms class-agnostic NMS
--augment augmented inference
--update update all models
--project PROJECT save results to project/name
--name NAME save results to project/name
--exist-ok existing project/name ok, do not increment