From c52c98430634a39e01c633006a303273d5c1a600 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 22 Oct 2024 11:06:50 -0600 Subject: [PATCH] fix calculation --- frigate/embeddings/functions/onnx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/embeddings/functions/onnx.py b/frigate/embeddings/functions/onnx.py index fd74d4768..bbffbfb0e 100644 --- a/frigate/embeddings/functions/onnx.py +++ b/frigate/embeddings/functions/onnx.py @@ -198,10 +198,10 @@ class GenericONNXEmbedding: width, height = pil.size if width > 112 or height > 112: if width > height: - new_height = int(((width / height) * 112) // 4 * 4) + new_height = int(((height / width) * 112) // 4 * 4) pil = pil.resize((112, new_height)) else: - new_width = int(((height / width) * 112) // 4 * 4) + new_width = int(((width / height) * 112) // 4 * 4) pil = pil.resize((new_width, 112)) og = np.array(pil).astype(np.float32)