Skip to content

Commit

Permalink
Fix region when no data in grid (blakeblackshear#8415)
Browse files Browse the repository at this point in the history
* Fix region when no data in grid

* Make comment more clear
  • Loading branch information
NickM-27 committed Nov 1, 2023
1 parent 8a9b26d commit 8b6e3a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frigate/util/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ def get_region_from_grid(

cell = region_grid[grid_x][grid_y]

# if there is no known data, get standard region for motion box
# if there is no known data, use original region calculation
if not cell or not cell["sizes"]:
return calculate_region(frame_shape, box[0], box[1], box[2], box[3], min_region)
return box

# convert the calculated region size to relative
calc_size = (box[2] - box[0]) / frame_shape[1]
Expand Down

0 comments on commit 8b6e3a0

Please sign in to comment.