mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 17:25:22 +03:00
Fix logical errors
- field migrations require default values - `clipped` referenced the wrong index for region, since it shifted - missed an inclusion of `ratio` for detections in `process_frames` - revert naming `o[2]` as `box` since it is out of scope! This has now been test-run against a video, so I believe the kinks are worked out. Issue: #2948
This commit is contained in:
parent
3bb3aecf97
commit
2ad0ed9b8d
@ -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
|
# 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
|
# consider the object to be clipped
|
||||||
box = obj[2]
|
box = obj[2]
|
||||||
region = obj[4]
|
region = obj[5]
|
||||||
if (
|
if (
|
||||||
(region[0] > 5 and box[0] - region[0] <= 5)
|
(region[0] > 5 and box[0] - region[0] <= 5)
|
||||||
or (region[1] > 5 and box[1] - region[1] <= 5)
|
or (region[1] > 5 and box[1] - region[1] <= 5)
|
||||||
|
|||||||
@ -591,6 +591,7 @@ def process_frames(
|
|||||||
obj["score"],
|
obj["score"],
|
||||||
obj["box"],
|
obj["box"],
|
||||||
obj["area"],
|
obj["area"],
|
||||||
|
obj["ratio"],
|
||||||
obj["region"],
|
obj["region"],
|
||||||
)
|
)
|
||||||
for obj in object_tracker.tracked_objects.values()
|
for obj in object_tracker.tracked_objects.values()
|
||||||
@ -626,13 +627,13 @@ def process_frames(
|
|||||||
for group in detected_object_groups.values():
|
for group in detected_object_groups.values():
|
||||||
|
|
||||||
# apply non-maxima suppression to suppress weak, overlapping bounding boxes
|
# 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 = [
|
boxes = [
|
||||||
(
|
(
|
||||||
box[0],
|
o[2][0],
|
||||||
box[1],
|
o[2][1],
|
||||||
box[2] - box[0],
|
o[2][2] - o[2][0],
|
||||||
box[3] - box[1],
|
o[2][3] - o[2][1],
|
||||||
)
|
)
|
||||||
for o in group
|
for o in group
|
||||||
]
|
]
|
||||||
|
|||||||
@ -30,7 +30,9 @@ SQL = pw.SQL
|
|||||||
def migrate(migrator, database, fake=False, **kwargs):
|
def migrate(migrator, database, fake=False, **kwargs):
|
||||||
migrator.add_fields(
|
migrator.add_fields(
|
||||||
Event,
|
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.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user