mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 15:45:27 +03:00
Crop frame to face box
This commit is contained in:
parent
ed243846cc
commit
33b0958531
@ -288,7 +288,21 @@ class EmbeddingMaintainer(threading.Thread):
|
|||||||
if not face:
|
if not face:
|
||||||
return
|
return
|
||||||
|
|
||||||
# TODO crop frame to face box
|
face_box = face.get("box")
|
||||||
|
|
||||||
|
if not face_box:
|
||||||
|
return
|
||||||
|
|
||||||
|
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]]
|
||||||
|
|
||||||
|
# if face_frame is not None:
|
||||||
|
# cv2.imwrite(
|
||||||
|
# "/media/frigate/face_crop.webp",
|
||||||
|
# face_frame,
|
||||||
|
# [int(cv2.IMWRITE_WEBP_QUALITY), 60],
|
||||||
|
# )
|
||||||
|
|
||||||
# TODO run embedding on face box
|
# TODO run embedding on face box
|
||||||
# TODO compare embedding to faces in embeddings DB to fine cosine similarity
|
# TODO compare embedding to faces in embeddings DB to fine cosine similarity
|
||||||
# TODO check against threshold and min score to see if best face qualifies
|
# TODO check against threshold and min score to see if best face qualifies
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user