Handle updating objects config

This commit is contained in:
Nicolas Mowen 2025-05-22 18:13:49 -06:00
parent 8cf418cf1e
commit 3572ef127e
2 changed files with 6 additions and 8 deletions

View File

@ -17,6 +17,7 @@ class CameraConfigUpdateEnum(str, Enum):
enabled = "enabled"
motion = "motion" # includes motion and motion masks
notifications = "notifications"
objects = "objects"
record = "record"
review = "review"
snapshots = "snapshots"
@ -83,6 +84,8 @@ class CameraConfigUpdateSubscriber:
config.motion = updated_config
elif update_type == CameraConfigUpdateEnum.notifications:
config.notifications = updated_config
elif update_type == CameraConfigUpdateEnum.objects:
config.objects = updated_config
elif update_type == CameraConfigUpdateEnum.record:
config.record = updated_config
elif update_type == CameraConfigUpdateEnum.review:

View File

@ -494,8 +494,6 @@ def track_camera(
frame_queue = camera_metrics.frame_queue
frame_shape = config.frame_shape
objects_to_track = config.objects.track
object_filters = config.objects.filters
motion_detector = ImprovedMotionDetector(
frame_shape,
@ -528,8 +526,6 @@ def track_camera(
object_tracker,
detected_objects_queue,
camera_metrics,
objects_to_track,
object_filters,
stop_event,
ptz_metrics,
region_grid,
@ -594,8 +590,6 @@ def process_frames(
object_tracker: ObjectTracker,
detected_objects_queue: Queue,
camera_metrics: CameraMetrics,
objects_to_track: list[str],
object_filters,
stop_event: MpEvent,
ptz_metrics: PTZMetrics,
region_grid: list[list[dict[str, Any]]],
@ -608,6 +602,7 @@ def process_frames(
CameraConfigUpdateEnum.detect,
CameraConfigUpdateEnum.enabled,
CameraConfigUpdateEnum.motion,
CameraConfigUpdateEnum.objects,
],
)
@ -825,8 +820,8 @@ def process_frames(
frame,
model_config,
region,
objects_to_track,
object_filters,
camera_config.objects.track,
camera_config.objects.filters,
)
)