From e037bcfcb4a251bdf214f6b55ecf26bb7029926f Mon Sep 17 00:00:00 2001 From: YS Date: Tue, 5 Apr 2022 14:47:36 +0300 Subject: [PATCH] fix the create_tensor_input cv2 resize --- frigate/video.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frigate/video.py b/frigate/video.py index 024a0b789..cd818785e 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -79,9 +79,10 @@ def create_tensor_input(frame, model_shape, region): cropped_frame = yuv_region_2_rgb(frame, region) # Resize to the model_shape if needed - if cropped_frame.shape != (model_shape[0], model_shape[1], 3): + height, width = model_shape + if cropped_frame.shape != (height, width, 3): cropped_frame = cv2.resize( - cropped_frame, dsize=model_shape, interpolation=cv2.INTER_LINEAR + cropped_frame, dsize=(width, height), interpolation=cv2.INTER_LINEAR ) # Return a tensor of shape: [height, width, 3] in RGB format return cropped_frame