Spaces:
Sleeping
Sleeping
correct dataAssociation
Browse files
eval.py
CHANGED
|
@@ -274,6 +274,20 @@ def correction_labels(boxes, labels, class_dict, pool_dict, flow_links):
|
|
| 274 |
print('change the link from sequenceFlow to messageFlow')
|
| 275 |
labels[i]=list(class_dict.values()).index('messageFlow')
|
| 276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
return labels, flow_links
|
| 278 |
|
| 279 |
|
|
|
|
| 274 |
print('change the link from sequenceFlow to messageFlow')
|
| 275 |
labels[i]=list(class_dict.values()).index('messageFlow')
|
| 276 |
|
| 277 |
+
for i in range(len(labels)):
|
| 278 |
+
#check if dataAssociation is connected to a dataObject
|
| 279 |
+
if labels[i] == list(class_dict.values()).index('dataAssociation'):
|
| 280 |
+
id1, id2 = flow_links[i]
|
| 281 |
+
if (id1 and id2) is not None:
|
| 282 |
+
label1 = labels[id1]
|
| 283 |
+
label2 = labels[id2]
|
| 284 |
+
if label1 == list(class_dict.values()).index('dataObject') or label2 == list(class_dict.values()).index('dataObject'):
|
| 285 |
+
continue
|
| 286 |
+
else:
|
| 287 |
+
print('change the link from dataAssociation to messageFlow')
|
| 288 |
+
labels[i]=list(class_dict.values()).index('messageFlow')
|
| 289 |
+
|
| 290 |
+
|
| 291 |
return labels, flow_links
|
| 292 |
|
| 293 |
|