Skip to content

Commit 99bdb46

Browse files
committed
Revert "Fix saving attributes for object to DB (#22000)"
This reverts commit 73c1e12.
1 parent 3101d5f commit 99bdb46

File tree

3 files changed

+2
-32
lines changed

3 files changed

+2
-32
lines changed

frigate/events/maintainer.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from frigate.comms.events_updater import EventEndPublisher, EventUpdateSubscriber
88
from frigate.config import FrigateConfig
9-
from frigate.config.classification import ObjectClassificationType
109
from frigate.events.types import EventStateEnum, EventTypeEnum
1110
from frigate.models import Event
1211
from frigate.util.builtin import to_relative_box
@@ -248,18 +247,6 @@ def handle_object_detection(
248247
"recognized_license_plate"
249248
][1]
250249

251-
# only overwrite attribute-type custom model fields in the database if they're set
252-
for name, model_config in self.config.classification.custom.items():
253-
if (
254-
model_config.object_config
255-
and model_config.object_config.classification_type
256-
== ObjectClassificationType.attribute
257-
):
258-
value = event_data.get(name)
259-
if value is not None:
260-
event[Event.data][name] = value[0]
261-
event[Event.data][f"{name}_score"] = value[1]
262-
263250
(
264251
Event.insert(event)
265252
.on_conflict(

frigate/track/object_processing.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
CameraConfigUpdateEnum,
3434
CameraConfigUpdateSubscriber,
3535
)
36-
from frigate.config.classification import ObjectClassificationType
3736
from frigate.const import (
3837
FAST_QUEUE_TIMEOUT,
3938
UPDATE_CAMERA_ACTIVITY,
@@ -760,16 +759,8 @@ def run(self) -> None:
760759

761760
self.update_mqtt_motion(camera, frame_time, motion_boxes)
762761

763-
attribute_model_names = [
764-
name
765-
for name, model_config in self.config.classification.custom.items()
766-
if model_config.object_config
767-
and model_config.object_config.classification_type
768-
== ObjectClassificationType.attribute
769-
]
770762
tracked_objects = [
771-
o.to_dict(attribute_model_names=attribute_model_names)
772-
for o in camera_state.tracked_objects.values()
763+
o.to_dict() for o in camera_state.tracked_objects.values()
773764
]
774765

775766
# publish info on this frame

frigate/track/tracked_object.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,7 @@ def update(
376376
)
377377
return (thumb_update, significant_change, path_update, autotracker_update)
378378

379-
def to_dict(
380-
self,
381-
attribute_model_names: list[str] | None = None,
382-
) -> dict[str, Any]:
379+
def to_dict(self) -> dict[str, Any]:
383380
event = {
384381
"id": self.obj_data["id"],
385382
"camera": self.camera_config.name,
@@ -414,11 +411,6 @@ def to_dict(
414411
"path_data": self.path_data.copy(),
415412
"recognized_license_plate": self.obj_data.get("recognized_license_plate"),
416413
}
417-
if attribute_model_names is not None:
418-
for name in attribute_model_names:
419-
value = self.obj_data.get(name)
420-
if value is not None:
421-
event[name] = value
422414

423415
return event
424416

0 commit comments

Comments
 (0)