github-actions[bot] commited on
Commit
904c006
·
1 Parent(s): 5407c65

Sync from GitHub: e183541197d8e0dcce4d172968f2290122cd5d77

Browse files
Files changed (1) hide show
  1. inference.py +4 -3
inference.py CHANGED
@@ -570,14 +570,15 @@ class InferenceProcessor:
570
  validated_fields["signature"] = signature_info
571
  validated_fields["stamp"] = stamp_info
572
 
573
- # Calculate overall confidence
574
- confidences = [field_confidence]
575
  if signature_info["present"]:
576
  confidences.append(signature_conf)
577
  if stamp_info["present"]:
578
  confidences.append(stamp_conf)
579
 
580
- overall_confidence = round(sum(confidences) / len(confidences), 3)
 
581
 
582
  # Calculate time and cost
583
  total_time = time.time() - total_start
 
570
  validated_fields["signature"] = signature_info
571
  validated_fields["stamp"] = stamp_info
572
 
573
+ # Calculate overall confidence - average of YOLO detection scores only
574
+ confidences = []
575
  if signature_info["present"]:
576
  confidences.append(signature_conf)
577
  if stamp_info["present"]:
578
  confidences.append(stamp_conf)
579
 
580
+ # If both sign and stamp detected, average them; otherwise use whichever is present
581
+ overall_confidence = round(sum(confidences) / len(confidences), 3) if confidences else 0.0
582
 
583
  # Calculate time and cost
584
  total_time = time.time() - total_start