From d2bbde07b866b4fc9b6b4b8412459c5c1aef640e Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 8 Jun 2021 18:47:13 +0200 Subject: [PATCH] Update FP16 `--half` argument for test.py and detect.py (#3532) * Update FP16 `--half` argument for test.py and detect.py * Update detect.py (cherry picked from commit c6b51f4189efbda055a08709cc35fcf5743379fd) --- detect.py | 2 +- test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/detect.py b/detect.py index aba87687e666..537f47dfafab 100644 --- a/detect.py +++ b/detect.py @@ -172,7 +172,7 @@ def detect(opt): parser.add_argument('--line-thickness', default=3, type=int, help='bounding box thickness (pixels)') parser.add_argument('--hide-labels', default=False, action='store_true', help='hide labels') parser.add_argument('--hide-conf', default=False, action='store_true', help='hide confidences') - parser.add_argument('--half', type=bool, default=False, help='use FP16 half-precision inference') + parser.add_argument('--half', action='store_true', help='use FP16 half-precision inference') opt = parser.parse_args() print(opt) check_requirements(exclude=('tensorboard', 'pycocotools', 'thop')) diff --git a/test.py b/test.py index 12141f71c2c1..6a2a4e47c142 100644 --- a/test.py +++ b/test.py @@ -306,7 +306,7 @@ def test(data, parser.add_argument('--project', default='runs/test', help='save to project/name') parser.add_argument('--name', default='exp', help='save to project/name') parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment') - parser.add_argument('--half', type=bool, default=False, help='use FP16 half-precision inference') + parser.add_argument('--half', action='store_true', help='use FP16 half-precision inference') opt = parser.parse_args() opt.save_json |= opt.data.endswith('coco.yaml') opt.data = check_file(opt.data) # check file