-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathResult.py
46 lines (36 loc) · 1.48 KB
/
Result.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from typing import *
from Lib import *
# ----- parameter -----
path_model_info: str = "./Result/Result_20201224192614/ModelInfo.json"
# ----- get model info -----
process_dict_data_loader = TrainProcess_DictLoad()
info = ModelInfo()
process_dict_data_loader.addDictData(info, path_model_info)
process_dict_data_loader.execute(-1, info, {})
# ----- plot model result -----
# best epoch
best_epoch = 97
# confusion matrix
plotConfusionMatrix(
info.result_list[best_epoch][3],
["Predict-NIL", "Predict-MOD", "Predict-SEV"],
["Ground-NIL", "Ground-MOD", "Ground-SEV"],
normalize=True)
plotConfusionMatrix(
info.result_list[best_epoch][4],
["Predict-MOD-T", "Predict-MOD-F", "Predict-SEV-T", "Predict-SEV-F"],
["Ground-MOD-T", "Ground-MOD-F", "Ground-SEV-T", "Ground-SEV-F"],
normalize=True)
plotConfusionMatrix(
info.result_list[best_epoch][5],
["Predict-NIL", "Predict-MOD", "Predict-SEV", "Predict-IOU-F"],
["Ground-NIL", "Ground-MOD", "Ground-SEV", "Ground-IOU-F"],
normalize=True)
# result
result_train: List[TrainResultInfo] = list(map(lambda x: x[2], info.result_list))
result_label: List[TrainResultInfo] = list(map(lambda x: x[3], info.result_list))
result_box: List[TrainResultInfo] = list(map(lambda x: x[4], info.result_list))
result_total: List[TrainResultInfo] = list(map(lambda x: x[5], info.result_list))
# accuracy and loss
plotAccuracy([result_label, result_total], ["Label", "Total"])
plotLoss([result_train, result_total], ["Train", "Val"])