mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 13:45:25 +03:00
Fix reading model config dict
This commit is contained in:
parent
216e44bc34
commit
dee94ec513
@ -1511,20 +1511,15 @@ class FrigateConfig(FrigateBaseModel):
|
|||||||
if detector_config.model is None:
|
if detector_config.model is None:
|
||||||
detector_config.model = config.model
|
detector_config.model = config.model
|
||||||
else:
|
else:
|
||||||
model = detector_config.model
|
path = detector_config.model.path
|
||||||
schema = ModelConfig.model_json_schema()["properties"]
|
detector_config.model = config.model
|
||||||
if (
|
detector_config.model.path = path
|
||||||
model.width != schema["width"]["default"]
|
|
||||||
or model.height != schema["height"]["default"]
|
if "path" not in model_dict or len(model_dict.keys()) > 1:
|
||||||
or model.labelmap_path is not None
|
|
||||||
or model.labelmap
|
|
||||||
or model.input_tensor != schema["input_tensor"]["default"]
|
|
||||||
or model.input_pixel_format
|
|
||||||
!= schema["input_pixel_format"]["default"]
|
|
||||||
):
|
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"Customizing more than a detector model path is unsupported."
|
"Customizing more than a detector model path is unsupported."
|
||||||
)
|
)
|
||||||
|
|
||||||
merged_model = deep_merge(
|
merged_model = deep_merge(
|
||||||
detector_config.model.model_dump(exclude_unset=True),
|
detector_config.model.model_dump(exclude_unset=True),
|
||||||
config.model.model_dump(exclude_unset=True),
|
config.model.model_dump(exclude_unset=True),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user