Skip to content

Commit

Permalink
Fix val arg parse
Browse files Browse the repository at this point in the history
  • Loading branch information
KSGulin committed Feb 8, 2023
1 parent d5687f4 commit 2b4a23a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions val.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,22 +365,21 @@ def parse_opt(skip_parse=False):
parser.add_argument('--half', action='store_true', help='use FP16 half-precision inference')
parser.add_argument('--dnn', action='store_true', help='use OpenCV DNN for ONNX inference')
parser.add_argument('--deepsparse', action='store_true', help='use the DeepSparse engine for ONNX inference')
opt = parser.parse_args()
opt.save_json |= opt.data.endswith('coco.yaml')
opt.save_txt |= opt.save_hybrid
print_args(vars(opt))

if skip_parse:
opt = parser.parse_args([])
else:
opt = parser.parse_args()

opt.data = check_yaml(opt.data) # check YAML
opt.save_json |= opt.data.endswith('coco.yaml')
opt.save_txt |= opt.save_hybrid
print_args(vars(opt))
return opt


def main(opt):
check_requirements(exclude=('tensorboard', 'thop'))

opt.data = check_yaml(opt.data) # check YAML
if opt.task in ('train', 'val', 'test'): # run normally
if opt.conf_thres > 0.001: # https://github.com/ultralytics/yolov5/issues/1466
LOGGER.info(f'WARNING ⚠️ confidence threshold {opt.conf_thres} > 0.001 produces invalid results')
Expand Down

0 comments on commit 2b4a23a

Please sign in to comment.