From 8549b79e14b3fe48e750da5d8635894723babd10 Mon Sep 17 00:00:00 2001 From: prajwalkr Date: Sun, 13 Sep 2020 08:57:51 +0530 Subject: [PATCH] Added user control for smoothing face dets --- inference.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inference.py b/inference.py index a1c721b..2202a4b 100644 --- a/inference.py +++ b/inference.py @@ -46,6 +46,9 @@ parser.add_argument('--rotate', default=False, action='store_true', help='Sometimes videos taken from a phone can be flipped 90deg. If true, will flip video right by 90deg.' 'Use if you get a flipped result, despite feeding a normal looking video') +parser.add_argument('--nosmooth', default=False, action='store_true', + help='Prevent smoothing face detections over a short temporal window') + args = parser.parse_args() args.img_size = 96 @@ -94,7 +97,7 @@ def face_detect(images): results.append([x1, y1, x2, y2]) - boxes = get_smoothened_boxes(np.array(results), T=5) + if not args.nosmooth: boxes = get_smoothened_boxes(np.array(results), T=5) results = [[image[y1: y2, x1:x2], (y1, y2, x1, x2)] for image, (x1, y1, x2, y2) in zip(images, boxes)] del detector