diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-30 23:51:59 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-30 23:51:59 +0200 |
commit | 04876c35a1eeea68794745f1ca113754c0d97757 (patch) | |
tree | b4664a71c031a9ced6f60c9e72632bad817f11df /text_recognizer/models/metrics.py | |
parent | 7268035fb9e57342612a8cc50a1fe04e8841ca2f (diff) |
black reformatting
Diffstat (limited to 'text_recognizer/models/metrics.py')
-rw-r--r-- | text_recognizer/models/metrics.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/text_recognizer/models/metrics.py b/text_recognizer/models/metrics.py index 9793157..0eb42dc 100644 --- a/text_recognizer/models/metrics.py +++ b/text_recognizer/models/metrics.py @@ -26,7 +26,9 @@ class CharacterErrorRate(Metric): bsz = preds.shape[0] for index in range(bsz): pred = [p for p in preds[index].tolist() if p not in self.ignore_indices] - target = [t for t in targets[index].tolist() if t not in self.ignore_indices] + target = [ + t for t in targets[index].tolist() if t not in self.ignore_indices + ] distance = editdistance.distance(pred, target) error = distance / max(len(pred), len(target)) self.error += error |