Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the min region size for grid as the model size #8486

Merged
merged 1 commit into from Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion frigate/app.py
Expand Up @@ -487,7 +487,9 @@ def init_historical_regions(self) -> None:
# create or update region grids for each camera
for camera in self.config.cameras.values():
self.region_grids[camera.name] = get_camera_regions_grid(
camera.name, camera.detect
camera.name,
camera.detect,
max(self.config.model.width, self.config.model.height),
)

def start_camera_processors(self) -> None:
Expand Down
6 changes: 5 additions & 1 deletion frigate/comms/dispatcher.py
Expand Up @@ -96,7 +96,11 @@ def _receive(self, topic: str, payload: str) -> None:
elif topic == REQUEST_REGION_GRID:
camera = payload
self.camera_metrics[camera]["region_grid_queue"].put(
get_camera_regions_grid(camera, self.config.cameras[camera].detect)
get_camera_regions_grid(
camera,
self.config.cameras[camera].detect,
max(self.config.model.width, self.config.model.height),
)
)
else:
self.publish(topic, payload, retain=False)
Expand Down
6 changes: 4 additions & 2 deletions frigate/util/object.py
Expand Up @@ -30,7 +30,9 @@


def get_camera_regions_grid(
name: str, detect: DetectConfig
name: str,
detect: DetectConfig,
min_region_size: int,
) -> list[list[dict[str, any]]]:
"""Build a grid of expected region sizes for a camera."""
# get grid from db if available
Expand Down Expand Up @@ -99,7 +101,7 @@ def get_camera_regions_grid(
box[1] * height,
(box[0] + box[2]) * width,
(box[1] + box[3]) * height,
320,
min_region_size,
1.35,
)
# save width of region to grid as relative
Expand Down