fix: face tracker — add iou>0.35+dist<100 condition for same-position matching
This commit is contained in:
@@ -184,8 +184,8 @@ def match_faces(
|
||||
|
||||
score = 0.0
|
||||
|
||||
# Always reject if embedding similarity is too low (different person)
|
||||
if use_embedding and curr_emb and prev_emb and similarity < 0.5:
|
||||
# Reject only if BOTH embedding AND IoU disagree (different person + different position)
|
||||
if use_embedding and curr_emb and prev_emb and similarity < 0.5 and iou < 0.3:
|
||||
continue
|
||||
|
||||
# Reject if bbox size changes by more than 5x (e.g., far shot → close-up)
|
||||
@@ -209,6 +209,8 @@ def match_faces(
|
||||
score = iou + similarity
|
||||
elif iou > 0.5 and similarity > 0.65:
|
||||
score = iou * 1.5 + similarity * 0.5
|
||||
elif iou > 0.35 and distance < distance_threshold:
|
||||
score = iou * 2 - distance / 500
|
||||
elif similarity > 0.85:
|
||||
score = similarity * 2
|
||||
elif similarity > 0.75 and distance < distance_threshold:
|
||||
|
||||
Reference in New Issue
Block a user