From ae1899daf6996788db41219abc2edf7a813188fe Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 20 Sep 2022 17:49:39 -0600 Subject: [PATCH] -1 so ensure indexes are correct --- frigate/video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/video.py b/frigate/video.py index 313495221..05246e788 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -457,8 +457,8 @@ def detect( size = region[2] - region[0] x_min = int(max(0, (box[1] * size) + region[0])) y_min = int(max(0, (box[0] * size) + region[1])) - x_max = int(min(detect_config.width, (box[3] * size) + region[0])) - y_max = int(min(detect_config.height, (box[2] * size) + region[1])) + x_max = int(min(detect_config.width - 1, (box[3] * size) + region[0])) + y_max = int(min(detect_config.height - 1, (box[2] * size) + region[1])) width = x_max - x_min height = y_max - y_min area = width * height