mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
update config merging and example config
This commit is contained in:
parent
7c283a1805
commit
2937dac4c3
@ -78,8 +78,6 @@ save_clips:
|
||||
objects:
|
||||
track:
|
||||
- person
|
||||
- car
|
||||
- truck
|
||||
filters:
|
||||
person:
|
||||
min_area: 5000
|
||||
@ -215,11 +213,12 @@ cameras:
|
||||
draw_zones: False
|
||||
|
||||
################
|
||||
# Camera level object config. This config is merged with the global config above.
|
||||
# Camera level object config. If defined, this is used instead of the global config.
|
||||
################
|
||||
objects:
|
||||
track:
|
||||
- person
|
||||
- car
|
||||
filters:
|
||||
person:
|
||||
min_area: 5000
|
||||
|
@ -267,13 +267,8 @@ def main():
|
||||
camera_objects_config = config.get('objects', {})
|
||||
# get objects to track for camera
|
||||
objects_to_track = camera_objects_config.get('track', GLOBAL_OBJECT_CONFIG.get('track', ['person']))
|
||||
# merge object filters
|
||||
global_object_filters = GLOBAL_OBJECT_CONFIG.get('filters', {})
|
||||
camera_object_filters = camera_objects_config.get('filters', {})
|
||||
objects_with_config = set().union(global_object_filters.keys(), camera_object_filters.keys())
|
||||
object_filters = {}
|
||||
for obj in objects_with_config:
|
||||
object_filters[obj] = {**global_object_filters.get(obj, {}), **camera_object_filters.get(obj, {})}
|
||||
# get object filters
|
||||
object_filters = camera_objects_config.get('filters', GLOBAL_OBJECT_CONFIG.get('filters', {}))
|
||||
config['objects'] = {
|
||||
'track': objects_to_track,
|
||||
'filters': object_filters
|
||||
|
Loading…
Reference in New Issue
Block a user