diff --git a/examples/example_spine_semantic.py b/examples/example_spine_semantic.py index d5c9c25..cbb2e7f 100644 --- a/examples/example_spine_semantic.py +++ b/examples/example_spine_semantic.py @@ -10,21 +10,25 @@ SemanticPair, ) -if __name__ == "__main__": - directory = turbopath(__file__).parent +directory = turbopath(__file__).parent - ref_masks = read_nifti(directory + "/spine_seg/semantic_example/sub-0007_mod-T2w_seg-spine_msk.nii.gz") - pred_masks = read_nifti(directory + "/spine_seg/semantic_example/sub-0007_mod-T2w_seg-spine_msk_new.nii.gz") +ref_masks = read_nifti( + directory + "/spine_seg/semantic_example/sub-0007_mod-T2w_seg-spine_msk.nii.gz" +) +pred_masks = read_nifti( + directory + "/spine_seg/semantic_example/sub-0007_mod-T2w_seg-spine_msk_new.nii.gz" +) - sample = SemanticPair(pred_masks, ref_masks) +sample = SemanticPair(pred_masks, ref_masks) - evaluator = Panoptic_Evaluator( - expected_input=SemanticPair, - instance_approximator=ConnectedComponentsInstanceApproximator(), - instance_matcher=NaiveThresholdMatching(), - iou_threshold=0.5, - ) - with cProfile.Profile() as pr: +evaluator = Panoptic_Evaluator( + expected_input=SemanticPair, + instance_approximator=ConnectedComponentsInstanceApproximator(), + instance_matcher=NaiveThresholdMatching(), + iou_threshold=0.5, +) +with cProfile.Profile() as pr: + if __name__ == "__main__": result, debug_data = evaluator.evaluate(sample) print(result)