From 04876c35a1eeea68794745f1ca113754c0d97757 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Fri, 30 Jul 2021 23:51:59 +0200 Subject: black reformatting --- text_recognizer/models/metrics.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'text_recognizer/models/metrics.py') 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 -- cgit v1.2.3-70-g09d2