From 7c3f842fb9acc65d46cb58ae7c62f9a8723b1ac9 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 22 Oct 2024 13:24:26 -0600 Subject: [PATCH] Use webp images --- frigate/embeddings/embeddings.py | 2 +- frigate/embeddings/maintainer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/embeddings/embeddings.py b/frigate/embeddings/embeddings.py index b8e0b21a3..f72ca6230 100644 --- a/frigate/embeddings/embeddings.py +++ b/frigate/embeddings/embeddings.py @@ -244,7 +244,7 @@ class Embeddings: # write face to library folder = os.path.join(FACE_DIR, label) - file = os.path.join(folder, f"{id}.jpg") + file = os.path.join(folder, f"{id}.webp") os.makedirs(folder, exist_ok=True) # save face image diff --git a/frigate/embeddings/maintainer.py b/frigate/embeddings/maintainer.py index 512874256..d0f351233 100644 --- a/frigate/embeddings/maintainer.py +++ b/frigate/embeddings/maintainer.py @@ -336,7 +336,7 @@ class EmbeddingMaintainer(threading.Thread): face_frame = cv2.cvtColor(frame, cv2.COLOR_YUV2BGR_I420) face_frame = face_frame[face_box[1] : face_box[3], face_box[0] : face_box[2]] ret, jpg = cv2.imencode( - ".jpg", face_frame, [int(cv2.IMWRITE_JPEG_QUALITY), 100] + ".webp", face_frame, [int(cv2.IMWRITE_WEBP_QUALITY), 100] ) if not ret: