diff --git a/frigate/util.py b/frigate/util.py index f11c0b0f9..621de3cbb 100755 --- a/frigate/util.py +++ b/frigate/util.py @@ -522,7 +522,7 @@ def clipped(obj, frame_shape): # if the object is within 5 pixels of the region border, and the region is not on the edge # consider the object to be clipped box = obj[2] - region = obj[4] + region = obj[5] if ( (region[0] > 5 and box[0] - region[0] <= 5) or (region[1] > 5 and box[1] - region[1] <= 5) diff --git a/frigate/video.py b/frigate/video.py index 80eef7551..55340d0a1 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -591,6 +591,7 @@ def process_frames( obj["score"], obj["box"], obj["area"], + obj["ratio"], obj["region"], ) for obj in object_tracker.tracked_objects.values() @@ -626,13 +627,13 @@ def process_frames( for group in detected_object_groups.values(): # apply non-maxima suppression to suppress weak, overlapping bounding boxes - box = o[2] # xmin, ymin, xmax, ymax + # o[2] is the box of the object: xmin, ymin, xmax, ymax boxes = [ ( - box[0], - box[1], - box[2] - box[0], - box[3] - box[1], + o[2][0], + o[2][1], + o[2][2] - o[2][0], + o[2][3] - o[2][1], ) for o in group ] diff --git a/migrations/007_add_object_filter_ratio.py b/migrations/007_add_object_filter_ratio.py index ebd6da8b1..454938339 100644 --- a/migrations/007_add_object_filter_ratio.py +++ b/migrations/007_add_object_filter_ratio.py @@ -30,7 +30,9 @@ SQL = pw.SQL def migrate(migrator, database, fake=False, **kwargs): migrator.add_fields( Event, - ratio=pw.FloatField(), + ratio=pw.FloatField( + default=1.0 + ), # There is no way to get the true ratio from an existing recording, so simply assume they are square. )