From 8ec42a5c8a0915211872d730e626020ae4dcd914 Mon Sep 17 00:00:00 2001 From: WenmuZhou <572459439@qq.com> Date: Thu, 6 Jan 2022 08:58:55 +0000 Subject: [PATCH] move import seqeval to get_metric fun --- ppocr/metrics/vqa_token_ser_metric.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppocr/metrics/vqa_token_ser_metric.py b/ppocr/metrics/vqa_token_ser_metric.py index 281c83a9..92d80d09 100644 --- a/ppocr/metrics/vqa_token_ser_metric.py +++ b/ppocr/metrics/vqa_token_ser_metric.py @@ -18,7 +18,6 @@ from __future__ import print_function import numpy as np import paddle -from seqeval.metrics import f1_score, precision_score, recall_score __all__ = ['KIEMetric'] @@ -34,6 +33,7 @@ class VQASerTokenMetric(object): self.gt_list.extend(labels) def get_metric(self): + from seqeval.metrics import f1_score, precision_score, recall_score metircs = { "precision": precision_score(self.gt_list, self.pred_list), "recall": recall_score(self.gt_list, self.pred_list), -- GitLab