From 87cd6189981510bb8b0645f99db49721d0de87d8 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Fri, 4 Feb 2022 07:40:53 -0600 Subject: [PATCH] randomize the region multiplier for variation --- frigate/video.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frigate/video.py b/frigate/video.py index 4c58b3ffb..7a32cca2b 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -3,6 +3,7 @@ import itertools import logging import multiprocessing as mp import queue +import random import signal import subprocess as sp import threading @@ -532,13 +533,23 @@ def process_frames( region_min_size = max(model_shape[0], model_shape[1]) # compute regions regions = [ - calculate_region(frame_shape, a[0], a[1], a[2], a[3], region_min_size, multiplier=1.2) + calculate_region( + frame_shape, + a[0], + a[1], + a[2], + a[3], + region_min_size, + multiplier=random.uniform(1.2, 1.5), + ) for a in combined_boxes ] # consolidate regions with heavy overlap regions = [ - calculate_region(frame_shape, a[0], a[1], a[2], a[3], region_min_size, multiplier=1.0) + calculate_region( + frame_shape, a[0], a[1], a[2], a[3], region_min_size, multiplier=1.0 + ) for a in reduce_boxes(regions, 0.4) ]