Object area debugging and improvements (#16432)

* add ability to specify min and max area as percentages

* debug draw area and ratio

* docs

* update for best percentage
This commit is contained in:
Josh Hawkins
2025-02-09 14:48:23 -07:00
committed by GitHub
parent 83beacf84a
commit c8cec63cb9
8 changed files with 352 additions and 21 deletions
+8
View File
@@ -29,6 +29,7 @@ from frigate.util.builtin import (
)
from frigate.util.config import (
StreamInfoRetriever,
convert_area_to_pixels,
find_config_file,
get_relative_coordinates,
migrate_frigate_config,
@@ -148,6 +149,13 @@ class RuntimeFilterConfig(FilterConfig):
if mask is not None:
config["mask"] = create_mask(frame_shape, mask)
# Convert min_area and max_area to pixels if they're percentages
if "min_area" in config:
config["min_area"] = convert_area_to_pixels(config["min_area"], frame_shape)
if "max_area" in config:
config["max_area"] = convert_area_to_pixels(config["max_area"], frame_shape)
super().__init__(**config)
def dict(self, **kwargs):