Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Sep 29, 2023
1 parent 26b1bc8 commit 9085026
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion frigate/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def get_standard_aspect_ratio(width: int, height: int) -> tuple[int, int]:
)
return known_aspects[known_aspects_ratios.index(closest)]


def get_canvas_shape(width: int, height: int) -> tuple[int, int]:
"""Get birdseye canvas shape."""
canvas_width = width
Expand All @@ -60,7 +61,9 @@ def get_canvas_shape(width: int, height: int) -> tuple[int, int]:
if round(a_w / a_h, 2) != round(width / height, 2):
canvas_width = width
canvas_height = (canvas_width / a_w) * a_h
logger.warning(f"The birdseye resolution is a non-standard aspect ratio, forcing birdseye resolution to {canvas_width} x {canvas_height}")
logger.warning(
f"The birdseye resolution is a non-standard aspect ratio, forcing birdseye resolution to {canvas_width} x {canvas_height}"
)

return (canvas_width, canvas_height)

Expand Down
2 changes: 1 addition & 1 deletion frigate/test/test_birdseye.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ def test_non_16x9(self):
width = 1280
height = 840
canvas_width, canvas_height = get_canvas_shape(width, height)
assert canvas_width == width # width will be the same
assert canvas_width == width # width will be the same
assert canvas_height != height

0 comments on commit 9085026

Please sign in to comment.