From 523f6fc3afa74bcd3d3e58c7cb929761d4b23921 Mon Sep 17 00:00:00 2001 From: sshuair Date: Sun, 28 Mar 2021 00:11:45 +0800 Subject: [PATCH 1/5] Include each class metrics in logs --- mmseg/datasets/custom.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mmseg/datasets/custom.py b/mmseg/datasets/custom.py index dc923fb42d..0f23e86849 100644 --- a/mmseg/datasets/custom.py +++ b/mmseg/datasets/custom.py @@ -374,6 +374,9 @@ 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[sub_metric+'.'+item[0]] = item[idx] / 100.0 if mmcv.is_list_of(results, str): for file_name in results: os.remove(file_name) From a3bf14de532eeb6117e6f5b9b5f26e4c5c6ab933 Mon Sep 17 00:00:00 2001 From: sshuair Date: Sun, 28 Mar 2021 08:19:40 +0800 Subject: [PATCH 2/5] format --- mmseg/datasets/custom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmseg/datasets/custom.py b/mmseg/datasets/custom.py index 0f23e86849..dcaf34580b 100644 --- a/mmseg/datasets/custom.py +++ b/mmseg/datasets/custom.py @@ -376,7 +376,7 @@ def evaluate(self, [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[sub_metric+'.'+item[0]] = item[idx] / 100.0 + eval_results[sub_metric + '.' + item[0]] = item[idx] / 100.0 if mmcv.is_list_of(results, str): for file_name in results: os.remove(file_name) From d5bc0cab328c53a22f104e5425929a13fbb3636d Mon Sep 17 00:00:00 2001 From: sshuair Date: Sun, 28 Mar 2021 15:32:51 +0800 Subject: [PATCH 3/5] fix the unitest --- mmseg/datasets/custom.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mmseg/datasets/custom.py b/mmseg/datasets/custom.py index dcaf34580b..55f06ff4a1 100644 --- a/mmseg/datasets/custom.py +++ b/mmseg/datasets/custom.py @@ -377,6 +377,7 @@ def evaluate(self, for idx, sub_metric in enumerate(class_table_data[0][1:], 1): for item in class_table_data[1:]: eval_results[sub_metric + '.' + item[0]] = item[idx] / 100.0 + if mmcv.is_list_of(results, str): for file_name in results: os.remove(file_name) From 34cf7918538d469f06efabfd4ef2e322dbfb547d Mon Sep 17 00:00:00 2001 From: sshuair Date: Sun, 28 Mar 2021 15:56:58 +0800 Subject: [PATCH 4/5] fix the custom int class_name --- mmseg/datasets/custom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmseg/datasets/custom.py b/mmseg/datasets/custom.py index 55f06ff4a1..5c1e3ae4fa 100644 --- a/mmseg/datasets/custom.py +++ b/mmseg/datasets/custom.py @@ -376,7 +376,7 @@ def evaluate(self, [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[sub_metric + '.' + item[0]] = item[idx] / 100.0 + eval_results[str(sub_metric) + '.' + str(item[0])] = item[idx] / 100.0 if mmcv.is_list_of(results, str): for file_name in results: From b8985d81ea4d5a51d2b407851a562700bfc6bc71 Mon Sep 17 00:00:00 2001 From: sshuair Date: Sun, 28 Mar 2021 16:01:09 +0800 Subject: [PATCH 5/5] fix the custom int class_name --- mmseg/datasets/custom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mmseg/datasets/custom.py b/mmseg/datasets/custom.py index 5c1e3ae4fa..79a03082d7 100644 --- a/mmseg/datasets/custom.py +++ b/mmseg/datasets/custom.py @@ -376,7 +376,8 @@ def evaluate(self, [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 + eval_results[str(sub_metric) + '.' + + str(item[0])] = item[idx] / 100.0 if mmcv.is_list_of(results, str): for file_name in results: