From f7a5d53a4b9860869dea07b2f3a7edb366feff89 Mon Sep 17 00:00:00 2001 From: sshuair Date: Tue, 30 Mar 2021 00:53:54 +0800 Subject: [PATCH] Include each class metrics in logs (#445) * Include each class metrics in logs * format * fix the unitest * fix the custom int class_name * fix the custom int class_name --- mmseg/datasets/custom.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mmseg/datasets/custom.py b/mmseg/datasets/custom.py index dc923fb42d..79a03082d7 100644 --- a/mmseg/datasets/custom.py +++ b/mmseg/datasets/custom.py @@ -374,6 +374,11 @@ def evaluate(self, for i in range(1, len(summary_table_data[0])): eval_results[summary_table_data[0] [i]] = summary_table_data[1][i] / 100.0 + for idx, sub_metric in enumerate(class_table_data[0][1:], 1): + for item in class_table_data[1:]: + eval_results[str(sub_metric) + '.' + + str(item[0])] = item[idx] / 100.0 + if mmcv.is_list_of(results, str): for file_name in results: os.remove(file_name)