mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-06-29 08:31:27 +03:00
preserve user-set min_score on attribute filters instead of bumping any 0.5 value
use model_fields_set to distinguish "user explicitly set min_score" from "Pydantic applied the generic FilterConfig default of 0.5"
This commit is contained in:
parent
43d97acd21
commit
65d3e9e82c
@ -629,10 +629,11 @@ class FrigateConfig(FrigateBaseModel):
|
|||||||
|
|
||||||
# set default min_score for object attributes
|
# set default min_score for object attributes
|
||||||
for attribute in self.model.all_attributes:
|
for attribute in self.model.all_attributes:
|
||||||
if not self.objects.filters.get(attribute):
|
existing = self.objects.filters.get(attribute)
|
||||||
|
if existing is None:
|
||||||
self.objects.filters[attribute] = FilterConfig(min_score=0.7)
|
self.objects.filters[attribute] = FilterConfig(min_score=0.7)
|
||||||
elif self.objects.filters[attribute].min_score == 0.5:
|
elif "min_score" not in existing.model_fields_set:
|
||||||
self.objects.filters[attribute].min_score = 0.7
|
existing.min_score = 0.7
|
||||||
|
|
||||||
# auto detect hwaccel args
|
# auto detect hwaccel args
|
||||||
if self.ffmpeg.hwaccel_args == "auto":
|
if self.ffmpeg.hwaccel_args == "auto":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user