Hanz Pillerva commited on
Commit ·
c2d4a57
1
Parent(s): 03e4696
update
Browse files- 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 →
|
| 191 |
-
#
|
| 192 |
-
conf =
|
| 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 |
|