Hanz Pillerva commited on
Commit
c2d4a57
·
1 Parent(s): 03e4696
Files changed (1) hide show
  1. template_matcher.py +3 -3
template_matcher.py CHANGED
@@ -187,9 +187,9 @@ def _crnn_read_batch_with_confidence(crops: list) -> list:
187
  # Mean confidence over character-bearing frames
188
  conf = float(max_probs[:, n][non_blank_mask].mean().item())
189
  else:
190
- # All blanks → empty / unreadable field; use overall mean as
191
- # a soft indicator (will typically be low ~0.3–0.5)
192
- conf = float(max_probs[:, n].mean().item())
193
 
194
  results.append((text, round(conf, 4)))
195
 
 
187
  # Mean confidence over character-bearing frames
188
  conf = float(max_probs[:, n][non_blank_mask].mean().item())
189
  else:
190
+ # All blanks → field is empty; correctly extracting nothing
191
+ # is 100% accurate, so return 1.0 instead of a low soft indicator.
192
+ conf = 1.0
193
 
194
  results.append((text, round(conf, 4)))
195