def test_annotation_with_misdetection(tracklet_graph, annotations, expected): """add some annotations with misdetection: 6*-> 7 -> 8* * denote misdetections """ annotations["labels"][1][6] = {-1, 5} annotations["labels"][2][7] = {5} annotations["labels"][3][8] = {-1, 5} # modify expected values accordingly: expected["nodes"][(2, 7)]["value"] = 1 annotated_graph = OpStructuredTracking.insertAnnotationsToHypothesesGraph(tracklet_graph, annotations) check_graph(annotated_graph._graph, expected)
def test_annotation_mismatch_raises(tracklet_graph, annotations): """add annotations that is not represented in the graph""" annotations["labels"][3][4] = {1, 3} with pytest.raises(AnnotationHypothesisgraphMismatchException): OpStructuredTracking.insertAnnotationsToHypothesesGraph(tracklet_graph, annotations)
def test_annotations_insertion(tracklet_graph, annotations, expected): """reproduces ilastik/#2052""" annotated_graph = OpStructuredTracking.insertAnnotationsToHypothesesGraph(tracklet_graph, annotations) check_graph(annotated_graph._graph, expected)