Use webp images

This commit is contained in:
Nicolas Mowen 2024-10-22 13:24:26 -06:00
parent e3cc943b0d
commit 7c3f842fb9
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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: