From bd92c22b6158318bc0c3aabb402f2ca73226b058 Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Mon, 19 Jul 2021 17:11:29 +0800 Subject: [PATCH] Reduce saved information to reduce memory usage --- ppocr/metrics/eval_det_iou.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/ppocr/metrics/eval_det_iou.py b/ppocr/metrics/eval_det_iou.py index 0e32b2d1..19b9008e 100644 --- a/ppocr/metrics/eval_det_iou.py +++ b/ppocr/metrics/eval_det_iou.py @@ -168,22 +168,27 @@ class DetectionIoUEvaluator(object): numGlobalCareGt += numGtCare numGlobalCareDet += numDetCare + # perSampleMetrics = { + # 'precision': precision, + # 'recall': recall, + # 'hmean': hmean, + # 'pairs': pairs, + # 'iouMat': [] if len(detPols) > 100 else iouMat.tolist(), + # 'gtPolPoints': gtPolPoints, + # 'detPolPoints': detPolPoints, + # 'gtCare': numGtCare, + # 'detCare': numDetCare, + # 'gtDontCare': gtDontCarePolsNum, + # 'detDontCare': detDontCarePolsNum, + # 'detMatched': detMatched, + # 'evaluationLog': evaluationLog + # } + perSampleMetrics = { - 'precision': precision, - 'recall': recall, - 'hmean': hmean, - 'pairs': pairs, - 'iouMat': [] if len(detPols) > 100 else iouMat.tolist(), - 'gtPolPoints': gtPolPoints, - 'detPolPoints': detPolPoints, 'gtCare': numGtCare, 'detCare': numDetCare, - 'gtDontCare': gtDontCarePolsNum, - 'detDontCare': detDontCarePolsNum, 'detMatched': detMatched, - 'evaluationLog': evaluationLog } - return perSampleMetrics def combine_results(self, results): -- GitLab