mtomnet/tbd/utils/helpers.py
2025-01-10 15:39:20 +01:00

210 lines
No EOL
38 KiB
Python

import numpy as np
import random
import torch
from sklearn.metrics import f1_score
tracker_skeID = {
'test1': 'skele1', 'test2': 'skele2', 'test6': 'skele2', 'test7': 'skele1','test_9434_1': 'skele2',
'test_9434_3': 'skele2', 'test_9434_18': 'skele1', 'test_94342_0': 'skele2', 'test_94342_1': 'skele2',
'test_94342_2': 'skele2', 'test_94342_3': 'skele2', 'test_94342_4': 'skele1', 'test_94342_5': 'skele1',
'test_94342_6': 'skele1', 'test_94342_7': 'skele1', 'test_94342_8': 'skele1',
'test_94342_10': 'skele2', 'test_94342_11': 'skele2', 'test_94342_12': 'skele1',
'test_94342_13': 'skele2', 'test_94342_14': 'skele1', 'test_94342_15': 'skele2',
'test_94342_16': 'skele1', 'test_94342_17': 'skele2', 'test_94342_18': 'skele1',
'test_94342_19': 'skele2', 'test_94342_20': 'skele1', 'test_94342_21': 'skele2',
'test_94342_22': 'skele1', 'test_94342_23': 'skele1', 'test_94342_24': 'skele1',
'test_94342_25': 'skele2', 'test_94342_26': 'skele1', 'test_boelter_1': 'skele2',
'test_boelter_2': 'skele2', 'test_boelter_3': 'skele2',
'test_boelter_4': 'skele1', 'test_boelter_5': 'skele1', 'test_boelter_6': 'skele1',
'test_boelter_7': 'skele1', 'test_boelter_9': 'skele1', 'test_boelter_10': 'skele1',
'test_boelter_12': 'skele2', 'test_boelter_13': 'skele1', 'test_boelter_14': 'skele1',
'test_boelter_15': 'skele1', 'test_boelter_17': 'skele2', 'test_boelter_18': 'skele1',
'test_boelter_19': 'skele2', 'test_boelter_21': 'skele1', 'test_boelter_22': 'skele2',
'test_boelter_24': 'skele1', 'test_boelter_25': 'skele1',
'test_boelter2_0': 'skele1', 'test_boelter2_2': 'skele1', 'test_boelter2_3': 'skele1',
'test_boelter2_4': 'skele1', 'test_boelter2_5': 'skele1', 'test_boelter2_6': 'skele1',
'test_boelter2_7': 'skele2', 'test_boelter2_8': 'skele2', 'test_boelter2_12': 'skele2',
'test_boelter2_14': 'skele2', 'test_boelter2_15': 'skele2', 'test_boelter2_16': 'skele1',
'test_boelter2_17': 'skele1',
'test_boelter3_0': 'skele1', 'test_boelter3_1': 'skele2', 'test_boelter3_2': 'skele2',
'test_boelter3_3': 'skele2', 'test_boelter3_4': 'skele1', 'test_boelter3_5': 'skele2',
'test_boelter3_6': 'skele2', 'test_boelter3_7': 'skele1', 'test_boelter3_8': 'skele2',
'test_boelter3_9': 'skele2', 'test_boelter3_10': 'skele1', 'test_boelter3_11': 'skele2',
'test_boelter3_12': 'skele2', 'test_boelter3_13': 'skele2',
'test_boelter4_0': 'skele2', 'test_boelter4_1': 'skele2', 'test_boelter4_2': 'skele2',
'test_boelter4_3': 'skele2', 'test_boelter4_4': 'skele2', 'test_boelter4_5': 'skele2',
'test_boelter4_6': 'skele2', 'test_boelter4_7': 'skele2', 'test_boelter4_8': 'skele2',
'test_boelter4_9': 'skele2', 'test_boelter4_10': 'skele2', 'test_boelter4_11': 'skele2',
'test_boelter4_12': 'skele2', 'test_boelter4_13': 'skele2',
}
event_seg_tracker = {
'test_9434_18': [[0, 749, 0], [750, 824, 0], [825, 863, 2], [864, 974, 0], [975, 1041, 0]],
'test_94342_1': [[0, 13, 0], [14, 104, 0], [105, 333, 0], [334, 451, 0], [452, 652, 0], [653, 897, 0], [898, 1076, 0], [1077, 1181, 0], [1181, 1266, 0],[1267, 1386, 0]],
'test_94342_6': [[0, 95, 0], [96, 267, 1], [268, 441, 1], [442, 559, 1], [560, 681, 1], [682, 796, 1], [797, 835, 1], [836, 901, 0], [902, 943, 1]],
'test_94342_10': [[0, 36, 0], [37, 169, 0], [170, 244, 1], [245, 424, 0], [425, 599, 0], [600, 640, 0], [641, 680, 0], [681, 726, 1], [727, 866, 2], [867, 1155, 2]],
'test_94342_21': [[0, 13, 0], [14, 66, 2], [67, 594, 2], [595, 1097, 2], [1098, 1133, 0]],
'test1': [[0, 477, 0], [478, 559, 0], [560, 689, 2], [690, 698, 0]],
'test6': [[0, 140, 0], [141, 375, 0], [376, 678, 0], [679, 703, 0]],
'test7': [[0, 100, 0], [101, 220, 2], [221, 226, 0]],
'test_boelter_2': [[0, 154, 0], [155, 279, 0], [280, 371, 0], [372, 450, 0], [451, 470, 0], [471, 531, 0],[532, 606, 0]],
'test_boelter_7': [[0, 69, 0], [70, 118, 1], [119, 239, 0], [240, 328, 1], [329, 376, 0], [377, 397, 1], [398, 520, 0], [521, 564, 0], [565, 619, 1], [620, 688, 1], [689, 871, 0], [872, 897, 0], [898, 958, 1], [959, 1010, 0], [1011, 1084, 0], [1085, 1140, 0], [1141, 1178, 0], [1179, 1267, 1], [1268, 1317, 0], [1318, 1327, 0]],
'test_boelter_24': [[0, 62, 0], [63, 185, 2], [186, 233, 2], [234, 292, 2], [293, 314, 0]],
'test_boelter_12': [[0, 47, 1], [48, 119, 0], [120, 157, 1], [158, 231, 0], [232, 317, 0], [318, 423, 0], [424,459,0], [460, 522, 0], [523, 586, 0], [587, 636, 0], [637, 745, 1], [746, 971, 2]],
'test_9434_1': [[0, 57, 0], [58, 124, 0], [125, 182, 1], [183, 251, 2],[252, 417, 0]],
'test_94342_16': [[0, 21, 0], [22, 45, 0], [46, 84, 0], [85, 158, 1], [159, 200, 1], [201, 214, 0],[215, 370, 1], [371, 524, 1], [525, 587, 2], [588, 782, 2],[783, 1009, 2]],
'test_boelter4_12': [[0, 141, 0], [142, 462, 2], [463, 605, 0], [606, 942, 2], [943, 1232, 2], [1233, 1293, 0]],
'test_boelter4_9': [[0, 27, 0], [28, 172, 0], [173, 221, 0], [222, 307, 1], [308, 466, 0], [467, 794, 1], [795, 866, 1], [867, 1005, 2], [1006, 1214, 2], [1215, 1270, 0]],
'test_boelter4_4': [[0, 120, 0], [121, 183, 0], [184, 280, 1], [281, 714, 0]],
'test_boelter4_3': [[0, 117, 0], [118, 200, 1], [201, 293, 1], [294, 404, 1], [405, 600, 1], [601, 800, 1], [801, 905, 1],[906, 1234, 1]],
'test_boelter4_1': [[0, 310, 0], [311, 560, 0], [561, 680, 0], [681, 748, 0], [749, 839, 0], [840, 1129, 0], [1130, 1237, 0]],
'test_boelter3_13': [[0, 204, 2], [205, 300, 2], [301, 488, 2], [489, 755, 2]],
'test_boelter3_11': [[0, 254, 1], [255, 424, 0], [425, 598, 1], [599, 692, 0], [693, 772, 2], [773, 878, 2], [879, 960, 2], [961, 1171, 2],[1172, 1397, 2]],
'test_boelter3_6': [[0, 174, 1], [175, 280, 1], [281, 639, 0], [640, 695, 1], [696, 788, 0], [789, 887, 2], [888, 1035, 1], [1036, 1445, 2]],
'test_boelter3_4': [[0, 158, 1], [159, 309, 1], [310, 477, 1], [478, 668, 1], [669, 780, 1], [781, 817, 0], [818, 848, 1], [849, 942, 1]],
'test_boelter3_0': [[0, 140, 0], [141, 353, 0], [354, 599, 0], [600, 727, 0],[728, 768, 0]],
'test_boelter2_15': [[0, 46, 0], [47, 252, 2], [253, 298, 1], [299, 414, 2], [415, 547, 2], [548, 690, 1], [691, 728, 1], [729, 773, 2],[774, 935, 2]],
'test_boelter2_12': [[0, 163, 0], [164, 285, 1], [286, 444, 1], [445, 519, 0], [520, 583, 1], [584, 623, 0], [624, 660, 0], [661, 854, 1], [855, 921, 1], [922, 1006, 2], [1007, 1125, 2],[1126, 1332, 2], [1333, 1416, 2]],
'test_boelter2_5': [[0, 94, 0], [95, 176, 1], [177, 246, 1], [247, 340, 1], [341, 442, 1], [443, 547, 1], [548, 654, 1], [655, 734, 0], [735, 792, 0], [793, 1019, 0], [1020, 1088, 0], [1089, 1206, 0], [1207, 1316, 1], [1317, 1466, 1], [1467, 1787, 2], [1788, 1936, 1], [1937, 2084, 2]],
'test_boelter2_4': [[0, 260, 1], [261, 421, 1], [422, 635, 1], [636, 741, 1], [742, 846, 1], [847, 903, 1], [904, 953, 1], [954, 1005, 1], [1006, 1148, 1], [1149, 1270, 1], [1271, 1525, 1]],
'test_boelter2_2': [[0, 131, 0], [132, 226, 0], [227, 267, 0], [268, 352, 0], [353, 412, 0], [413, 457, 0], [458, 502, 0], [503, 532, 0], [533, 578, 0], [579, 640, 0], [641, 722, 0], [723, 826, 0], [827, 913, 0], [914, 992, 0], [993, 1070, 0], [1071, 1265, 0], [1266, 1412, 0]],
'test_boelter_21': [[0, 238, 1], [239, 310, 0], [311, 373, 1], [374, 457, 0],[458, 546, 2], [547, 575, 1], [576, 748, 2], [749, 952, 2]],
}
event_seg_battery={
'test1': [[0, 94, 0], [95, 155, 0], [156, 225, 0], [226, 559, 0], [560, 689, 2], [690, 698, 0]],
'test7': [[0, 70, 0], [71, 100, 0], [101, 220, 2], [221, 226, 0]],
'test6': [[0, 488, 0], [489, 541, 0], [542, 672, 0], [673, 703, 0]],
'test_94342_10': [[0, 156, 0], [157, 169, 0], [170, 244, 1], [245, 274, 0], [275, 389, 0], [390, 525, 0], [526, 665, 0], [666, 680, 0], [681, 726, 1], [727, 866, 2], [867, 1155, 2]],
'test_94342_1': [[0, 751, 0], [752, 876, 0], [877, 1167, 0], [1168, 1386, 0]],
'test_9434_18': [[0, 96, 0], [97, 361, 0], [362, 528, 0], [529, 608, 0], [609, 824, 0], [825, 863, 2], [864, 1041, 0]],
'test_94342_6': [[0, 95, 0], [96, 267, 1], [268, 441, 1], [442, 559, 1], [560, 681, 1], [682, 796, 1], [797, 835, 1], [836, 901, 0], [902, 943, 1]],
'test_boelter_24': [[0, 62, 0], [63, 185, 2], [186, 233, 2], [234, 292, 2], [293, 314, 0]],
'test_boelter2_4': [[0, 260, 1], [261, 421, 1], [422, 635, 1], [636, 741, 1], [742, 846, 1], [847, 903, 1], [904, 953, 1], [954, 1005, 1], [1006, 1148, 1], [1149, 1270, 1], [1271, 1525, 1]],
'test_boelter2_5': [[0, 94, 0], [95, 176, 1], [177, 246, 1], [247, 340, 1], [341, 442, 1], [443, 547, 1], [548, 654, 1], [655, 1206, 0], [1207, 1316, 1], [1317, 1466, 1], [1467, 1787, 2], [1788, 1936, 1], [1937, 2084, 2]],
'test_boelter2_2': [[0, 145, 0], [146, 224, 0], [225, 271, 0], [272, 392, 0], [393, 454, 0], [455, 762, 0], [763, 982, 0], [983, 1412, 0]],
'test_boelter_21': [[0, 238, 1], [239, 285, 0], [286, 310, 0], [311, 373, 1], [374, 457, 0], [458, 546, 2], [547, 575, 1], [576, 748, 2], [749, 952, 2]],
'test_9434_1': [[0, 67, 0], [68, 124, 0], [125, 182, 1], [183, 251, 2], [252, 343, 0], [344, 380, 0], [381, 417, 0]],
'test_boelter3_6': [[0, 174, 1], [175, 280, 1], [281, 498, 0], [499, 639, 0], [640, 695, 1], [696, 748, 0], [749, 788, 0], [789, 887, 2], [888, 1035, 1], [1036, 1445, 2]],
'test_boelter3_4': [[0, 158, 1], [159, 309, 1], [310, 477, 1], [478, 668, 1], [669, 780, 1], [781, 817, 0], [818, 848, 1], [849, 942, 1]],
'test_boelter3_0': [[0, 102, 0], [103, 480, 0], [481, 703, 0], [704, 768, 0]],
'test_boelter2_12': [[0, 163, 0], [164, 285, 1], [286, 444, 1], [445, 519, 0], [520, 583, 1], [584, 660, 0], [661, 854, 1], [855, 921, 1], [922, 1006, 2], [1007, 1125, 2], [1126, 1332, 2], [1333, 1416, 2]],
'test_94342_16': [[0, 84, 0], [85, 158, 1], [159, 200, 1], [201, 214, 0], [215, 370, 1], [371, 524, 1], [525, 587, 2], [588, 782, 2], [783, 1009, 2]],
'test_boelter2_15': [[0, 46, 0], [47, 252, 2], [253, 298, 1], [299, 414, 2], [415, 547, 2], [548, 690, 1], [691, 728, 1], [729, 773, 2], [774, 935, 2]],
'test_boelter3_13': [[0, 204, 2], [205, 300, 2], [301, 488, 2], [489, 755, 2]],
'test_boelter3_11': [[0, 254, 1], [255, 424, 0], [425, 598, 1], [599, 692, 0], [693, 772, 2], [773, 878, 2], [879, 960, 2], [961, 1171, 2], [1172, 1397, 2]],
'test_boelter4_12': [[0, 32, 0], [33, 141, 0], [142, 462, 2], [463, 519, 0], [520, 597, 0], [598, 605, 0], [606, 942, 2], [943, 1232, 2], [1233, 1293, 0]],
'test_boelter4_9': [[0, 221, 0], [222, 307, 1], [308, 466, 0], [467, 794, 1], [795, 866, 1], [867, 1005, 2], [1006, 1214, 2], [1215, 1270, 0]],
'test_boelter4_4': [[0, 183, 0], [184, 280, 1], [281, 529, 0], [530, 714, 0]],
'test_boelter4_1': [[0, 252, 0], [253, 729, 0], [730, 1202, 0], [1203, 1237, 0]],
'test_boelter4_3': [[0, 117, 0], [118, 200, 1], [201, 293, 1], [294, 404, 1], [405, 600, 1], [601, 800, 1], [801, 905, 1], [906, 1234, 1]],
'test_boelter_12': [[0, 47, 1], [48, 119, 0], [120, 157, 1], [158, 636, 0], [637, 745, 1], [746, 971, 2]],
'test_boelter_7': [[0, 69, 0], [70, 118, 1], [119, 133, 0], [134, 187, 0], [188, 239, 0], [240, 328, 1], [329, 376, 0], [377, 397, 1], [398, 491, 0], [492, 564, 0], [565, 619, 1], [620, 688, 1], [689, 774, 0], [775, 862, 0], [863, 897, 0], [898, 958, 1], [959, 1000, 0], [1001, 1178, 0], [1179, 1267, 1], [1268, 1307, 0], [1308, 1327, 0]],
'test_94342_21': [[0, 13, 0], [14, 66, 2], [67, 594, 2], [595, 1097, 2], [1098, 1133, 0]],
'test_boelter_2': [[0, 318, 0], [319, 458, 0], [459, 543, 0], [544, 606, 0]]
}
CLIPS_OBJ_BY_ID_88 = {'test1': ['P2', 'O1', 'O2', 'O3', 'P1', 'O4'], 'test2': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test6': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test7': ['P1', 'P2', 'O1'], 'test_94342_0': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12', 'O13'], 'test_94342_1': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12', 'O13', 'O14'], 'test_94342_10': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test_94342_11': ['P1', 'P2', 'O2', 'O1', 'O3', 'O4'], 'test_94342_12': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8'], 'test_94342_13': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10'], 'test_94342_14': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O14', 'O15'], 'test_94342_15': ['P1', 'P2', 'O1'], 'test_94342_16': ['P1', 'P2', 'O4', 'O1'], 'test_94342_17': ['P1', 'P2', 'O1', 'O2', 'O4', 'O5', 'O6'], 'test_94342_18': ['P1', 'P2', 'O1', 'O2'], 'test_94342_19': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O8', 'O9'], 'test_94342_2': ['P2', 'P1', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11'], 'test_94342_20': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5'], 'test_94342_21': ['P2', 'P1', 'O1', 'O2'], 'test_94342_22': ['P1', 'P2', 'O1', 'O2'], 'test_94342_23': ['P2', 'P1', 'O1', 'O2'], 'test_94342_24': ['P2', 'P1', 'O1', 'O2'], 'test_94342_25': ['P2', 'P1', 'O1'], 'test_94342_26': ['P2', 'P1', 'O1', 'O2'], 'test_94342_3': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12', 'O13'], 'test_94342_4': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12'], 'test_94342_5': ['P2', 'P1', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11'], 'test_94342_6': ['P2', 'P1', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_94342_7': ['P2', 'P1', 'O1', 'O2', 'O3'], 'test_94342_8': ['P2', 'P1', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6'], 'test_9434_1': ['P1', 'P2', 'O1', 'O2'], 'test_9434_18': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test_9434_3': ['P1', 'P2', 'O1', 'O2'], 'test_boelter2_0': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10'], 'test_boelter2_12': ['P1', 'P2', 'O1', 'O2', 'O4', 'O5'], 'test_boelter2_14': ['P1', 'P2', 'O1', 'O2', 'O3'], 'test_boelter2_15': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter2_16': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9'], 'test_boelter2_17': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6'], 'test_boelter2_3': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10'], 'test_boelter2_6': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test_boelter2_7': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter2_8': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11'], 'test_boelter3_0': ['P1', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'P2'], 'test_boelter3_1': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8'], 'test_boelter3_10': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test_boelter3_11': ['P1', 'P2', 'O1', 'O2', 'O3'], 'test_boelter3_12': ['P1', 'P2', 'O1', 'O2'], 'test_boelter3_13': ['P1', 'P2', 'O1', 'O2', 'O3'], 'test_boelter3_2': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12'], 'test_boelter3_3': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter3_4': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter3_5': ['P1', 'P2', 'O1', 'O2'], 'test_boelter3_6': ['P1', 'P2', 'O1', 'O2', 'O3'], 'test_boelter3_7': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test_boelter3_8': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter3_9': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10'], 'test_boelter4_0': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10'], 'test_boelter4_1': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8'], 'test_boelter4_10': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter4_11': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test_boelter4_12': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter4_13': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test_boelter4_2': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test_boelter4_3': ['P1', 'P2', 'O1', 'O5', 'O2', 'O3', 'O4', 'O6'], 'test_boelter4_4': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test_boelter4_5': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test_boelter4_6': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter4_7': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6'], 'test_boelter4_8': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter4_9': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter_1': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O7', 'O6', 'O8'], 'test_boelter_10': ['P1', 'O1', 'P2', 'O2'], 'test_boelter_12': ['P2', 'P1', 'O1', 'O2', 'O3'], 'test_boelter_13': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4'], 'test_boelter_14': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter_15': ['P1', 'P2', 'O1', 'O2', 'O3'], 'test_boelter_17': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter_18': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6'], 'test_boelter_19': ['P1', 'P2', 'O1', 'O2'], 'test_boelter_2': ['P1', 'P2', 'O1', 'O2', 'O3', 'O5', 'O6', 'O7', 'O8'], 'test_boelter_21': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter_3': ['P1', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'P2', 'O9', 'O10', 'O11', 'O12', 'O13', 'O14'], 'test_boelter_4': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter_5': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11'], 'test_boelter_6': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11'], 'test_boelter_7': ['P1', 'P2', 'O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12', 'O13', 'O14'], 'test_boelter_9': ['P1', 'P2', 'O1', 'O2']}
CLIPS_OBJ_BY_ID_88_NO_P = {'test1': ['O1', 'O2', 'O3', 'O4'], 'test2': ['O1', 'O2', 'O3', 'O4'], 'test6': ['O1', 'O2', 'O3', 'O4'], 'test7': ['O1'], 'test_94342_0': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12', 'O13'], 'test_94342_1': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12', 'O13', 'O14'], 'test_94342_10': ['O1', 'O2', 'O3', 'O4'], 'test_94342_11': ['O2', 'O1', 'O3', 'O4'], 'test_94342_12': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8'], 'test_94342_13': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10'], 'test_94342_14': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O14', 'O15'], 'test_94342_15': ['O1'], 'test_94342_16': ['O4', 'O1'], 'test_94342_17': ['O1', 'O2', 'O4', 'O5', 'O6'], 'test_94342_18': ['O1', 'O2'], 'test_94342_19': ['O1', 'O2', 'O3', 'O4', 'O5', 'O8', 'O9'], 'test_94342_2': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11'], 'test_94342_20': ['O1', 'O2', 'O3', 'O4', 'O5'], 'test_94342_21': ['O1', 'O2'], 'test_94342_22': ['O1', 'O2'], 'test_94342_23': ['O1', 'O2'], 'test_94342_24': ['O1', 'O2'], 'test_94342_25': ['O1'], 'test_94342_26': ['O1', 'O2'], 'test_94342_3': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12', 'O13'], 'test_94342_4': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12'], 'test_94342_5': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11'], 'test_94342_6': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_94342_7': ['O1', 'O2', 'O3'], 'test_94342_8': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6'], 'test_9434_1': ['O1', 'O2'], 'test_9434_18': ['O1', 'O2', 'O3', 'O4'], 'test_9434_3': ['O1', 'O2'], 'test_boelter2_0': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10'], 'test_boelter2_12': ['O1', 'O2', 'O4', 'O5'], 'test_boelter2_14': ['O1', 'O2', 'O3'], 'test_boelter2_15': ['O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter2_16': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9'], 'test_boelter2_17': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6'], 'test_boelter2_3': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10'], 'test_boelter2_6': ['O1', 'O2', 'O3', 'O4'], 'test_boelter2_7': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter2_8': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11'], 'test_boelter3_0': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter3_1': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8'], 'test_boelter3_10': ['O1', 'O2', 'O3', 'O4'], 'test_boelter3_11': ['O1', 'O2', 'O3'], 'test_boelter3_12': ['O1', 'O2'], 'test_boelter3_13': ['O1', 'O2', 'O3'], 'test_boelter3_2': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12'], 'test_boelter3_3': ['O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter3_4': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter3_5': ['O1', 'O2'], 'test_boelter3_6': ['O1', 'O2', 'O3'], 'test_boelter3_7': ['O1', 'O2', 'O3', 'O4'], 'test_boelter3_8': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter3_9': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10'], 'test_boelter4_0': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10'], 'test_boelter4_1': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8'], 'test_boelter4_10': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter4_11': ['O1', 'O2', 'O3', 'O4'], 'test_boelter4_12': ['O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter4_13': ['O1', 'O2', 'O3', 'O4'], 'test_boelter4_2': ['O1', 'O2', 'O3', 'O4'], 'test_boelter4_3': ['O1', 'O5', 'O2', 'O3', 'O4', 'O6'], 'test_boelter4_4': ['O1', 'O2', 'O3', 'O4'], 'test_boelter4_5': ['O1', 'O2', 'O3', 'O4'], 'test_boelter4_6': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter4_7': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6'], 'test_boelter4_8': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter4_9': ['O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter_1': ['O1', 'O2', 'O3', 'O4', 'O5', 'O7', 'O6', 'O8'], 'test_boelter_10': ['O1', 'O2'], 'test_boelter_12': ['O1', 'O2', 'O3'], 'test_boelter_13': ['O1', 'O2', 'O3', 'O4'], 'test_boelter_14': ['O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter_15': ['O1', 'O2', 'O3'], 'test_boelter_17': ['O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter_18': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6'], 'test_boelter_19': ['O1', 'O2'], 'test_boelter_2': ['O1', 'O2', 'O3', 'O5', 'O6', 'O7', 'O8'], 'test_boelter_21': ['O1', 'O2', 'O3', 'O4', 'O5'], 'test_boelter_3': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12', 'O13', 'O14'], 'test_boelter_4': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7'], 'test_boelter_5': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11'], 'test_boelter_6': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11'], 'test_boelter_7': ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12', 'O13', 'O14'], 'test_boelter_9': ['O1', 'O2']}
CLIPS_OBJ_NUM_BY_ID_88 = {'test1': 6, 'test2': 6, 'test6': 6, 'test7': 3, 'test_94342_0': 15, 'test_94342_1': 16, 'test_94342_10': 6, 'test_94342_11': 6, 'test_94342_12': 10, 'test_94342_13': 12, 'test_94342_14': 15, 'test_94342_15': 3, 'test_94342_16': 4, 'test_94342_17': 7, 'test_94342_18': 4, 'test_94342_19': 9, 'test_94342_2': 13, 'test_94342_20': 7, 'test_94342_21': 4, 'test_94342_22': 4, 'test_94342_23': 4, 'test_94342_24': 4, 'test_94342_25': 3, 'test_94342_26': 4, 'test_94342_3': 15, 'test_94342_4': 14, 'test_94342_5': 13, 'test_94342_6': 9, 'test_94342_7': 5, 'test_94342_8': 8, 'test_9434_1': 4, 'test_9434_18': 6, 'test_9434_3': 4, 'test_boelter2_0': 12, 'test_boelter2_12': 6, 'test_boelter2_14': 5, 'test_boelter2_15': 7, 'test_boelter2_16': 11, 'test_boelter2_17': 8, 'test_boelter2_3': 12, 'test_boelter2_6': 6, 'test_boelter2_7': 9, 'test_boelter2_8': 13, 'test_boelter3_0': 9, 'test_boelter3_1': 10, 'test_boelter3_10': 6, 'test_boelter3_11': 5, 'test_boelter3_12': 4, 'test_boelter3_13': 5, 'test_boelter3_2': 14, 'test_boelter3_3': 7, 'test_boelter3_4': 9, 'test_boelter3_5': 4, 'test_boelter3_6': 5, 'test_boelter3_7': 6, 'test_boelter3_8': 10, 'test_boelter3_9': 12, 'test_boelter4_0': 12, 'test_boelter4_1': 10, 'test_boelter4_10': 9, 'test_boelter4_11': 6, 'test_boelter4_12': 7, 'test_boelter4_13': 6, 'test_boelter4_2': 6, 'test_boelter4_3': 8, 'test_boelter4_4': 6, 'test_boelter4_5': 6, 'test_boelter4_6': 9, 'test_boelter4_7': 8, 'test_boelter4_8': 9, 'test_boelter4_9': 7, 'test_boelter_1': 10, 'test_boelter_10': 4, 'test_boelter_12': 5, 'test_boelter_13': 6, 'test_boelter_14': 7, 'test_boelter_15': 5, 'test_boelter_17': 7, 'test_boelter_18': 8, 'test_boelter_19': 4, 'test_boelter_2': 9, 'test_boelter_21': 7, 'test_boelter_3': 16, 'test_boelter_4': 9, 'test_boelter_5': 13, 'test_boelter_6': 13, 'test_boelter_7': 16, 'test_boelter_9': 4}
CLIPS_LEN_BY_ID_88 = {'test_94342_13': 1455, 'test_boelter4_11': 1355, 'test_94342_20': 1865, 'test_94342_0': 1940, 'test_94342_23': 539, 'test_boelter4_5': 1166, 'test_boelter_12': 972, 'test_9434_3': 323, 'test_boelter_15': 1055, 'test_94342_19': 1695, 'test_boelter_21': 953, 'test_boelter3_2': 1326, 'test_boelter4_0': 1322, 'test_boelter_18': 1386, 'test6': 704, 'test_boelter_1': 925, 'test_boelter3_6': 1446, 'test_94342_21': 1134, 'test_boelter4_10': 1263, 'test_9434_1': 418, 'test_94342_17': 1057, 'test_boelter4_9': 1271, 'test_94342_18': 1539, 'test_boelter4_12': 1294, 'test_boelter3_11': 1398, 'test_boelter4_1': 1238, 'test_94342_26': 527, 'test_boelter_10': 654, 'test_boelter4_8': 1006, 'test_boelter3_8': 1161, 'test2': 975, 'test_94342_7': 1386, 'test_94342_16': 1010, 'test_boelter2_17': 1268, 'test_boelter_4': 787, 'test_boelter3_3': 861, 'test_94342_1': 1387, 'test_boelter_13': 1004, 'test_boelter3_1': 1351, 'test_boelter2_8': 1347, 'test_boelter2_14': 920, 'test_boelter2_0': 1143, 'test7': 227, 'test_94342_3': 1776, 'test_boelter2_12': 1417, 'test_94342_8': 1795, 'test_boelter4_7': 1401, 'test_9434_18': 1042, 'test_94342_22': 586, 'test_94342_5': 2292, 'test_boelter3_9': 1383, 'test1': 699, 'test_boelter_6': 1435, 'test_boelter_19': 959, 'test_boelter4_13': 933, 'test_94342_10': 1156, 'test_boelter4_4': 715, 'test_boelter3_4': 943, 'test_boelter2_3': 942, 'test_boelter_5': 834, 'test_94342_12': 2417, 'test_boelter_14': 904, 'test_boelter3_0': 769, 'test_94342_6': 944, 'test_94342_15': 1174, 'test_94342_24': 741, 'test_boelter_2': 607, 'test_boelter_7': 1328, 'test_boelter_3': 596, 'test_94342_4': 1924, 'test_boelter4_2': 1353, 'test_boelter3_13': 756, 'test_94342_25': 568, 'test_boelter2_16': 1734, 'test_boelter3_5': 851, 'test_boelter4_3': 1235, 'test_boelter4_6': 1334, 'test_boelter3_10': 1301, 'test_boelter2_7': 1505, 'test_94342_14': 1841, 'test_boelter3_7': 1544, 'test_boelter2_15': 936, 'test_boelter_9': 636, 'test_boelter2_6': 2100, 'test_boelter3_12': 359, 'test_boelter_17': 817, 'test_94342_11': 1610, 'test_94342_2': 1968}
CLIPS_IDS_88 = ['test_94342_13', 'test_boelter4_11', 'test_94342_20', 'test_94342_0', 'test_94342_23', 'test_boelter4_5', 'test_boelter_12', 'test_9434_3', 'test_boelter_15', 'test_94342_19', 'test_boelter_21', 'test_boelter3_2', 'test_boelter4_0', 'test_boelter_18', 'test6', 'test_boelter_1', 'test_boelter3_6', 'test_94342_21', 'test_boelter4_10', 'test_9434_1', 'test_94342_17', 'test_boelter4_9', 'test_94342_18', 'test_boelter4_12', 'test_boelter3_11', 'test_boelter4_1', 'test_94342_26', 'test_boelter_10', 'test_boelter4_8', 'test_boelter3_8', 'test2', 'test_94342_7', 'test_94342_16', 'test_boelter2_17', 'test_boelter_4', 'test_boelter3_3', 'test_94342_1', 'test_boelter_13', 'test_boelter3_1', 'test_boelter2_8', 'test_boelter2_14', 'test_boelter2_0', 'test7', 'test_94342_3', 'test_boelter2_12', 'test_94342_8', 'test_boelter4_7', 'test_9434_18', 'test_94342_22', 'test_94342_5', 'test_boelter3_9', 'test1', 'test_boelter_6', 'test_boelter_19', 'test_boelter4_13', 'test_94342_10', 'test_boelter4_4', 'test_boelter3_4', 'test_boelter2_3', 'test_boelter_5', 'test_94342_12', 'test_boelter_14', 'test_boelter3_0', 'test_94342_6', 'test_94342_15', 'test_94342_24', 'test_boelter_2', 'test_boelter_7', 'test_boelter_3', 'test_94342_4', 'test_boelter4_2', 'test_boelter3_13', 'test_94342_25', 'test_boelter2_16', 'test_boelter3_5', 'test_boelter4_3', 'test_boelter4_6', 'test_boelter3_10', 'test_boelter2_7', 'test_94342_14', 'test_boelter3_7', 'test_boelter2_15', 'test_boelter_9', 'test_boelter2_6', 'test_boelter3_12', 'test_boelter_17', 'test_94342_11', 'test_94342_2']
CLIPS_LEN_88 = [1455, 1355, 1865, 1940, 539, 1166, 972, 323, 1055, 1695, 953, 1326, 1322, 1386, 704, 925, 1446, 1134, 1263, 418, 1057, 1271, 1539, 1294, 1398, 1238, 527, 654, 1006, 1161, 975, 1386, 1010, 1268, 787, 861, 1387, 1004, 1351, 1347, 920, 1143, 227, 1776, 1417, 1795, 1401, 1042, 586, 2292, 1383, 699, 1435, 959, 933, 1156, 715, 943, 942, 834, 2417, 904, 769, 944, 1174, 741, 607, 1328, 596, 1924, 1353, 756, 568, 1734, 851, 1235, 1334, 1301, 1505, 1841, 1544, 936, 636, 2100, 359, 817, 1610, 1968]
CLIPS_WITH_GT_EVENT =['test_boelter2_15', 'test_94342_16', 'test_boelter4_4', 'test_94342_21', 'test_boelter4_1', 'test_boelter4_9', 'test_94342_1', 'test_boelter3_4', 'test_boelter_2', 'test_boelter_21', 'test_boelter4_12', 'test_boelter_7', 'test7', 'test_9434_18', 'test_94342_10', 'test_boelter3_13', 'test_94342_6', 'test1', 'test_boelter_12', 'test_boelter3_0', 'test6', 'test_9434_1', 'test_boelter2_12', 'test_boelter3_6', 'test_boelter4_3', 'test_boelter3_11']
CLIPS_LEN_BY_ID = {'test_94342_13': 1455, 'test_boelter4_11': 1355, 'test_94342_20': 1865, 'test_94342_0': 1940, 'test_94342_23': 539, 'test_boelter4_5': 1166, 'test_boelter_12': 972, 'test_9434_3': 323, 'test_boelter_15': 1055, 'test_94342_19': 1695, 'test_boelter_21': 953, 'test_boelter3_2': 1326, 'test_boelter4_0': 1322, 'test_boelter_18': 1386, 'test6': 704, 'test_boelter_1': 925, 'test_boelter3_6': 1446, 'test_94342_21': 1134, 'test_boelter4_10': 1263, 'test_9434_1': 418, 'test_94342_17': 1057, 'test_boelter4_9': 1271, 'test_94342_18': 1539, 'test_boelter4_12': 1294, 'test_boelter3_11': 1398, 'test_boelter4_1': 1238, 'test_94342_26': 527, 'test_boelter_10': 654, 'test_boelter4_8': 1006, 'test_boelter3_8': 1161, 'test2': 975, 'test_94342_7': 1386, 'test_94342_16': 1010, 'test_boelter2_17': 1268, 'test_boelter_4': 787, 'test_boelter3_3': 861, 'test_94342_1': 1387, 'test_boelter_13': 1004, 'test_boelter_24': 315, 'test_boelter3_1': 1351, 'test_boelter2_8': 1347, 'test_boelter2_2': 1413, 'test_boelter2_14': 920, 'test_boelter2_0': 1143, 'test7': 227, 'test_94342_3': 1776, 'test_boelter2_12': 1417, 'test_94342_8': 1795, 'test_boelter4_7': 1401, 'test_9434_18': 1042, 'test_94342_22': 586, 'test_94342_5': 2292, 'test_boelter3_9': 1383, 'test1': 699, 'test_boelter_6': 1435, 'test_boelter_19': 959, 'test_boelter4_13': 933, 'test_94342_10': 1156, 'test_boelter4_4': 715, 'test_boelter3_4': 943, 'test_boelter2_3': 942, 'test_boelter_5': 834, 'test_94342_12': 2417, 'test_boelter_14': 904, 'test_boelter3_0': 769, 'test_94342_6': 944, 'test_94342_15': 1174, 'test_94342_24': 741, 'test_boelter_2': 607, 'test_boelter2_5': 2085, 'test_boelter_7': 1328, 'test_boelter_3': 596, 'test_94342_4': 1924, 'test_boelter4_2': 1353, 'test_boelter3_13': 756, 'test_94342_25': 568, 'test_boelter2_16': 1734, 'test_boelter3_5': 851, 'test_boelter4_3': 1235, 'test_boelter4_6': 1334, 'test_boelter3_10': 1301, 'test_boelter2_7': 1505, 'test_94342_14': 1841, 'test_boelter_22': 828, 'test_boelter3_7': 1544, 'test_boelter2_15': 936, 'test_boelter_9': 636, 'test_boelter_25': 951, 'test_boelter2_6': 2100, 'test_boelter2_4': 1526, 'test_boelter3_12': 359, 'test_boelter_17': 817, 'test_94342_11': 1610, 'test_94342_2': 1968}
CLIPS_LEN = [1455, 1355, 1865, 1940, 539, 1166, 972, 323, 1055, 1695, 953, 1326, 1322, 1386, 704, 925, 1446, 1134, 1263, 418, 1057, 1271, 1539, 1294, 1398, 1238, 527, 654, 1006, 1161, 975, 1386, 1010, 1268, 787, 861, 1387, 1004, 315, 1351, 1347, 1413, 920, 1143, 227, 1776, 1417, 1795, 1401, 1042, 586, 2292, 1383, 699, 1435, 959, 933, 1156, 715, 943, 942, 834, 2417, 904, 769, 944, 1174, 741, 607, 2085, 1328, 596, 1924, 1353, 756, 568, 1734, 851, 1235, 1334, 1301, 1505, 1841, 828, 1544, 936, 636, 951, 2100, 1526, 359, 817, 1610, 1968]
CLIPS_IDS = ['test_94342_13', 'test_boelter4_11', 'test_94342_20', 'test_94342_0', 'test_94342_23', 'test_boelter4_5', 'test_boelter_12', 'test_9434_3', 'test_boelter_15', 'test_94342_19', 'test_boelter_21', 'test_boelter3_2', 'test_boelter4_0', 'test_boelter_18', 'test6', 'test_boelter_1', 'test_boelter3_6', 'test_94342_21', 'test_boelter4_10', 'test_9434_1', 'test_94342_17', 'test_boelter4_9', 'test_94342_18', 'test_boelter4_12', 'test_boelter3_11', 'test_boelter4_1', 'test_94342_26', 'test_boelter_10', 'test_boelter4_8', 'test_boelter3_8', 'test2', 'test_94342_7', 'test_94342_16', 'test_boelter2_17', 'test_boelter_4', 'test_boelter3_3', 'test_94342_1', 'test_boelter_13', 'test_boelter_24', 'test_boelter3_1', 'test_boelter2_8', 'test_boelter2_2', 'test_boelter2_14', 'test_boelter2_0', 'test7', 'test_94342_3', 'test_boelter2_12', 'test_94342_8', 'test_boelter4_7', 'test_9434_18', 'test_94342_22', 'test_94342_5', 'test_boelter3_9', 'test1', 'test_boelter_6', 'test_boelter_19', 'test_boelter4_13', 'test_94342_10', 'test_boelter4_4', 'test_boelter3_4', 'test_boelter2_3', 'test_boelter_5', 'test_94342_12', 'test_boelter_14', 'test_boelter3_0', 'test_94342_6', 'test_94342_15', 'test_94342_24', 'test_boelter_2', 'test_boelter2_5', 'test_boelter_7', 'test_boelter_3', 'test_94342_4', 'test_boelter4_2', 'test_boelter3_13', 'test_94342_25', 'test_boelter2_16', 'test_boelter3_5', 'test_boelter4_3', 'test_boelter4_6', 'test_boelter3_10', 'test_boelter2_7', 'test_94342_14', 'test_boelter_22', 'test_boelter3_7', 'test_boelter2_15', 'test_boelter_9', 'test_boelter_25', 'test_boelter2_6', 'test_boelter2_4', 'test_boelter3_12', 'test_boelter_17', 'test_94342_11', 'test_94342_2']
ALL_IDS = ['test_boelter_15', 'test6', 'test_94342_7', 'test_94342_10', 'test_94342_21', 'test_boelter2_8', 'test_boelter4_1', 'test_boelter3_1', 'test_boelter3_11', 'test_boelter3_10', 'test_boelter3_0', 'test_boelter4_0', 'test_94342_20', 'test_94342_11', 'test_94342_6', 'test_boelter_1', 'test_9434_3', 'test7', 'test_boelter_14', 'test_boelter2_12', 'test_boelter2_3', 'test_9434_1', 'test_94342_4', 'test_boelter_3', 'test_boelter3_8', 'test_94342_13', 'test_boelter4_8', 'test_94342_22', 'test_boelter_9', 'test_boelter4_2', 'test_boelter3_2', 'test_94342_19', 'test_boelter3_12', 'test_boelter3_13', 'test_boelter3_3', 'test_94342_18', 'test_boelter4_3', 'test_9434_18', 'test_94342_23', 'test_boelter4_9', 'test_boelter3_9', 'test_94342_12', 'test_94342_5', 'test_boelter_2', 'test_boelter2_0', 'test_boelter_17', 'test_boelter2_15', 'test_boelter_13', 'test_boelter_6', 'test_94342_1', 'test_94342_16', 'test_boelter4_10', 'test_boelter_19', 'test_boelter4_7', 'test_boelter3_7', 'test_boelter3_6', 'test_boelter4_6', 'test_boelter_18', 'test_boelter4_11', 'test_94342_26', 'test_94342_17', 'test1', 'test_boelter_7', 'test_94342_0', 'test_boelter_12', 'test_boelter2_14', 'test_boelter_10', 'test_boelter2_7', 'test_boelter2_16', 'test_boelter_5', 'test_94342_2', 'test_94342_15', 'test_94342_8', 'test_94342_24', 'test_boelter4_13', 'test_boelter4_4', 'test_boelter_21', 'test_boelter3_4', 'test_boelter3_5', 'test_boelter4_5', 'test_boelter4_12', 'test_94342_25', 'test_94342_14', 'test2', 'test_boelter_4', 'test_94342_3', 'test_boelter2_6', 'test_boelter2_17']
UNIQUE_OBJ_IDS = ['O1', 'O2', 'O3', 'O4', 'O5', 'O6', 'O7', 'O8', 'O9', 'O10', 'O11', 'O12', 'O13', 'O14', 'O15']
mind_test_clips = ['test_boelter4_5.p', 'test_94342_2.p', 'test_boelter4_10.p', 'test_boelter2_3.p', 'test_94342_20.p', 'test_boelter3_9.p', 'test_boelter4_6.p', 'test2.p', 'test_boelter4_2.p', 'test_94342_24.p', 'test_94342_17.p', 'test_94342_8.p', 'test_94342_11.p', 'test_boelter3_7.p', 'test_94342_18.p', 'test_boelter_10.p', 'test_boelter3_8.p', 'test_boelter2_6.p', 'test_boelter4_7.p', 'test_boelter4_8.p', 'test_boelter4_0.p', 'test_boelter2_17.p', 'test_boelter3_12.p', 'test_boelter3_5.p', 'test_94342_4.p', 'test_94342_15.p']
def count_parameters(model):
model_parameters = filter(lambda p: p.requires_grad, model.parameters())
return sum([np.prod(p.size()) for p in model_parameters])
def split_train_val_test():
# Calculate the total number of frames
total_frames = sum(CLIPS_LEN_BY_ID_88.values())
# Calculate the number of frames for each split
train_frames = int(total_frames * 0.6)
validation_frames = int(total_frames * 0.2)
# Convert the dictionary to a list of tuples (video_id, frame_length)
video_list = list(CLIPS_LEN_BY_ID_88.items())
# Shuffle the video list randomly
random.shuffle(video_list)
# Split the videos based on the number of frames
train_ids = []
validation_ids = []
test_ids = []
frames_count = 0
for video_id, frames in video_list:
if frames_count < train_frames:
train_ids.append(video_id)
elif frames_count < train_frames + validation_frames:
validation_ids.append(video_id)
else:
test_ids.append(video_id)
frames_count += frames
# Print the results
print("Train IDs:", train_ids)
print("Validation IDs:", validation_ids)
print("Test IDs:", test_ids)
train_frames_total = sum(CLIPS_LEN_BY_ID_88[video_id] for video_id in train_ids)
validation_frames_total = sum(CLIPS_LEN_BY_ID_88[video_id] for video_id in validation_ids)
test_frames_total = sum(CLIPS_LEN_BY_ID_88[video_id] for video_id in test_ids)
print("Total frames for train_ids:", train_frames_total)
print("Total frames for validation_ids:", validation_frames_total)
print("Total frames for test_ids:", test_frames_total)
return train_ids, validation_ids, test_ids
def compute_f1_scores(m1_pred, m1_label, m2_pred, m2_label, m12_pred, m12_label, m21_pred, m21_label, mc_pred, mc_label, verbose=False):
# Compute F1 score for m1
m1_pred_labels = torch.argmax(m1_pred, dim=-1).cpu().numpy()
m1_true_labels = m1_label.cpu().numpy()
if verbose: print(f'm1 --- pred {np.unique(m1_pred_labels, return_counts=True)}, true {np.unique(m1_true_labels, return_counts=True)}')
m1_f1_score = f1_score(m1_true_labels, m1_pred_labels, average='macro')
# Compute F1 score for m2
m2_pred_labels = torch.argmax(m2_pred, dim=-1).cpu().numpy()
m2_true_labels = m2_label.cpu().numpy()
if verbose: print(f'm2 --- pred {np.unique(m2_pred_labels, return_counts=True)}, true {np.unique(m2_true_labels, return_counts=True)}')
m2_f1_score = f1_score(m2_true_labels, m2_pred_labels, average='macro')
# Compute F1 score for m12
m12_pred_labels = torch.argmax(m12_pred, dim=-1).cpu().numpy()
m12_true_labels = m12_label.cpu().numpy()
if verbose: print(f'm12 --- pred {np.unique(m12_pred_labels, return_counts=True)}, true {np.unique(m12_true_labels, return_counts=True)}')
m12_f1_score = f1_score(m12_true_labels, m12_pred_labels, average='macro')
# Compute F1 score for m21
m21_pred_labels = torch.argmax(m21_pred, dim=-1).cpu().numpy()
m21_true_labels = m21_label.cpu().numpy()
if verbose: print(f'm21 --- pred {np.unique(m21_pred_labels, return_counts=True)}, true {np.unique(m21_true_labels, return_counts=True)}')
m21_f1_score = f1_score(m21_true_labels, m21_pred_labels, average='macro')
# Compute F1 score for mc
mc_pred_labels = torch.argmax(mc_pred, dim=-1).cpu().numpy()
mc_true_labels = mc_label.cpu().numpy()
if verbose: print(f'mc --- pred {np.unique(mc_pred_labels, return_counts=True)}, true {np.unique(mc_true_labels, return_counts=True)}')
mc_f1_score = f1_score(mc_true_labels, mc_pred_labels, average='macro')
return m1_f1_score, m2_f1_score, m12_f1_score, m21_f1_score, mc_f1_score