Skip to content

Commit

Permalink
Merge pull request #25 from BrainLesion/fix_multiprocessing_example_a…
Browse files Browse the repository at this point in the history
…ttempt_two

here we go again
  • Loading branch information
neuronflow authored Nov 14, 2023
2 parents a84a272 + c33b258 commit 6ffb6aa
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions examples/example_spine_semantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 6ffb6aa

Please sign in to comment.