mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-10 17:17:42 +03:00
Revert "Fix saving attributes for object to DB (#22000)"
This reverts commit 73c1e12faf.
This commit is contained in:
parent
3101d5f27b
commit
99bdb46750
@ -6,7 +6,6 @@ from typing import Dict
|
|||||||
|
|
||||||
from frigate.comms.events_updater import EventEndPublisher, EventUpdateSubscriber
|
from frigate.comms.events_updater import EventEndPublisher, EventUpdateSubscriber
|
||||||
from frigate.config import FrigateConfig
|
from frigate.config import FrigateConfig
|
||||||
from frigate.config.classification import ObjectClassificationType
|
|
||||||
from frigate.events.types import EventStateEnum, EventTypeEnum
|
from frigate.events.types import EventStateEnum, EventTypeEnum
|
||||||
from frigate.models import Event
|
from frigate.models import Event
|
||||||
from frigate.util.builtin import to_relative_box
|
from frigate.util.builtin import to_relative_box
|
||||||
@ -248,18 +247,6 @@ class EventProcessor(threading.Thread):
|
|||||||
"recognized_license_plate"
|
"recognized_license_plate"
|
||||||
][1]
|
][1]
|
||||||
|
|
||||||
# only overwrite attribute-type custom model fields in the database if they're set
|
|
||||||
for name, model_config in self.config.classification.custom.items():
|
|
||||||
if (
|
|
||||||
model_config.object_config
|
|
||||||
and model_config.object_config.classification_type
|
|
||||||
== ObjectClassificationType.attribute
|
|
||||||
):
|
|
||||||
value = event_data.get(name)
|
|
||||||
if value is not None:
|
|
||||||
event[Event.data][name] = value[0]
|
|
||||||
event[Event.data][f"{name}_score"] = value[1]
|
|
||||||
|
|
||||||
(
|
(
|
||||||
Event.insert(event)
|
Event.insert(event)
|
||||||
.on_conflict(
|
.on_conflict(
|
||||||
|
|||||||
@ -33,7 +33,6 @@ from frigate.config.camera.updater import (
|
|||||||
CameraConfigUpdateEnum,
|
CameraConfigUpdateEnum,
|
||||||
CameraConfigUpdateSubscriber,
|
CameraConfigUpdateSubscriber,
|
||||||
)
|
)
|
||||||
from frigate.config.classification import ObjectClassificationType
|
|
||||||
from frigate.const import (
|
from frigate.const import (
|
||||||
FAST_QUEUE_TIMEOUT,
|
FAST_QUEUE_TIMEOUT,
|
||||||
UPDATE_CAMERA_ACTIVITY,
|
UPDATE_CAMERA_ACTIVITY,
|
||||||
@ -760,16 +759,8 @@ class TrackedObjectProcessor(threading.Thread):
|
|||||||
|
|
||||||
self.update_mqtt_motion(camera, frame_time, motion_boxes)
|
self.update_mqtt_motion(camera, frame_time, motion_boxes)
|
||||||
|
|
||||||
attribute_model_names = [
|
|
||||||
name
|
|
||||||
for name, model_config in self.config.classification.custom.items()
|
|
||||||
if model_config.object_config
|
|
||||||
and model_config.object_config.classification_type
|
|
||||||
== ObjectClassificationType.attribute
|
|
||||||
]
|
|
||||||
tracked_objects = [
|
tracked_objects = [
|
||||||
o.to_dict(attribute_model_names=attribute_model_names)
|
o.to_dict() for o in camera_state.tracked_objects.values()
|
||||||
for o in camera_state.tracked_objects.values()
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# publish info on this frame
|
# publish info on this frame
|
||||||
|
|||||||
@ -376,10 +376,7 @@ class TrackedObject:
|
|||||||
)
|
)
|
||||||
return (thumb_update, significant_change, path_update, autotracker_update)
|
return (thumb_update, significant_change, path_update, autotracker_update)
|
||||||
|
|
||||||
def to_dict(
|
def to_dict(self) -> dict[str, Any]:
|
||||||
self,
|
|
||||||
attribute_model_names: list[str] | None = None,
|
|
||||||
) -> dict[str, Any]:
|
|
||||||
event = {
|
event = {
|
||||||
"id": self.obj_data["id"],
|
"id": self.obj_data["id"],
|
||||||
"camera": self.camera_config.name,
|
"camera": self.camera_config.name,
|
||||||
@ -414,11 +411,6 @@ class TrackedObject:
|
|||||||
"path_data": self.path_data.copy(),
|
"path_data": self.path_data.copy(),
|
||||||
"recognized_license_plate": self.obj_data.get("recognized_license_plate"),
|
"recognized_license_plate": self.obj_data.get("recognized_license_plate"),
|
||||||
}
|
}
|
||||||
if attribute_model_names is not None:
|
|
||||||
for name in attribute_model_names:
|
|
||||||
value = self.obj_data.get(name)
|
|
||||||
if value is not None:
|
|
||||||
event[name] = value
|
|
||||||
|
|
||||||
return event
|
return event
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user