fix hash creation in face store

This commit is contained in:
henryruhs
2026-07-29 10:11:46 +02:00
parent 5dcd46369e
commit 35a50bccb1
+3 -3
View File
@@ -10,7 +10,7 @@ FACE_STORE : FaceStore = {}
def get_faces(vision_frame : VisionFrame) -> Optional[List[Face]]:
if is_vision_frame(vision_frame):
vision_hash = create_hash(vision_frame.data)
vision_hash = create_hash(vision_frame.tobytes())
if FACE_STORE.get(vision_hash):
return FACE_STORE.get(vision_hash).get('faces')
@@ -20,7 +20,7 @@ def get_faces(vision_frame : VisionFrame) -> Optional[List[Face]]:
def set_faces(vision_frame : VisionFrame, faces : List[Face]) -> None:
if is_vision_frame(vision_frame):
vision_hash = create_hash(vision_frame.data)
vision_hash = create_hash(vision_frame.tobytes())
FACE_STORE.setdefault(vision_hash,
{
'lock': threading.Lock()
@@ -29,7 +29,7 @@ def set_faces(vision_frame : VisionFrame, faces : List[Face]) -> None:
def resolve_lock(vision_frame : VisionFrame) -> threading.Lock:
if is_vision_frame(vision_frame):
vision_hash = create_hash(vision_frame.data)
vision_hash = create_hash(vision_frame.tobytes())
return FACE_STORE.setdefault(vision_hash,
{
'lock': threading.Lock()