fix stationary runtime error (#20309)

This commit is contained in:
Nicolas Mowen 2025-10-01 09:17:30 -06:00 committed by GitHub
parent 8430fbc705
commit 993459152b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
"""Tools for determining if an object is stationary.""" """Tools for determining if an object is stationary."""
import logging import logging
from dataclasses import dataclass from dataclasses import dataclass, field
from typing import Any, cast from typing import Any, cast
import cv2 import cv2
@ -20,7 +20,7 @@ class StationaryThresholds:
# Objects to apply these thresholds to # Objects to apply these thresholds to
# If None, apply to all objects # If None, apply to all objects
objects: list[str] = [] objects: list[str] = field(default_factory=list)
# Threshold of IoU that causes the object to immediately be considered active # Threshold of IoU that causes the object to immediately be considered active
# Below this threshold, assume object is active # Below this threshold, assume object is active
@ -51,6 +51,7 @@ STATIONARY_OBJECT_THRESHOLDS = StationaryThresholds(
# Thresholds for objects that are active but can be stationary for longer periods of time # Thresholds for objects that are active but can be stationary for longer periods of time
DYNAMIC_OBJECT_THRESHOLDS = StationaryThresholds( DYNAMIC_OBJECT_THRESHOLDS = StationaryThresholds(
objects=["bicycle", "boat", "car", "motorcycle", "tractor", "truck"], objects=["bicycle", "boat", "car", "motorcycle", "tractor", "truck"],
active_check_iou=0.75,
motion_classifier_enabled=True, motion_classifier_enabled=True,
) )