Skip to content

Commit

Permalink
runner/live: Fix image resize logic to always set width,heiht (#281)
Browse files Browse the repository at this point in the history
The log afterwards was breaking
  • Loading branch information
victorges authored Nov 18, 2024
1 parent e4aac00 commit 27c969f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runner/app/live/streamer/streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ async def run_ingress_loop(self, done: Event):

# crop the max square from the center of the image and scale to 512x512
# most models expect this size especially when using tensorrt
if frame.width != frame.height:
width, height = frame.size
width, height = frame.size
if width != height:
square_size = min(width, height)
frame = frame.crop((width // 2 - square_size // 2, height // 2 - square_size // 2, width // 2 + square_size // 2, height // 2 + square_size // 2))
if frame.size != (512, 512):
Expand Down

0 comments on commit 27c969f

Please sign in to comment.