Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packaging nnunet for inference #40

Merged
merged 32 commits into from
Aug 11, 2023
Merged

packaging nnunet for inference #40

merged 32 commits into from
Aug 11, 2023

Conversation

naga-karthik
Copy link
Member

This PR adds a script for running inference using nnUNet. Currently, the script is tested on joplin with CPUs only. The inference on 1 Zurich subject takes about 30s on average.

@valosekj
Copy link
Member

valosekj commented Jun 21, 2023

Thanks! 💯 Tested and worked well!

The commands I used:

single image

python run_inference.py --path-images ~/data/sci-zurich/sub-zh01/ses-01/anat/sub-zh01_ses-01_acq-sag_T2w.nii.gz --path-out . --path-model ~/data/nnunetv2/nnUNet_results/Dataset501_tSCIZurichCrop/nnUNetTrainer__nnUNetPlans__3d_fullres

For this specific subject (sub-zh01_ses-01_acq-sag_T2w.nii.gz), inference took 87.33 seconds.

dataset

python run_inference.py --path-dataset ~/extrassd1/janvalosek/data/site_012_lesion_inference --path-out . --path-model ~/extrassd1/janvalosek/data/nnunetv2/nnUNet_results/Dataset525_tSCILesionsZurichGoodSubjects/nnUNetTrainer__nnUNetPlans__3d_fullres

Total time elapsed: 291.84 seconds

@valosekj
Copy link
Member

Just an idea - since the script is actually universal, we could consider moving it to ivadomed/data-conversion (but we would need to rename the repo again since data-conversion would not fit).

@naga-karthik
Copy link
Member Author

That's a great idea! Could you please open an issue in the data-conversion repository so that others might have an opinion too?

@valosekj
Copy link
Member

That's a great idea! Could you please open an issue in the data-conversion repository so that others might have an opinion too?

👍🏻 I reopened the issue ivadomed/utilities#9 discussing the repo name.

@valosekj
Copy link
Member

Okay, the repo has been renamed (ivadomed/utilities#9 (comment)) to ivadomed/utilities. I guess we can push the script there.

@valosekj
Copy link
Member

Tested (#40 (comment)) and working fine! I guess we can close this PR and move the script to https://github.com/ivadomed/utilities.

@valosekj
Copy link
Member

I guess we can close this PR and move the script to https://github.com/ivadomed/utilities.

Done in ivadomed/utilities@1d8112f.

Copy link
Member

@jcohenadad jcohenadad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to also have a section in the README to make it easier for people to run the inference, as done here: https://github.com/ivadomed/model_seg_ms_mp2rage#segment-an-image and here: https://github.com/ivadomed/model_seg_mouse-sc_wm-gm_t1#run-inference

@naga-karthik
Copy link
Member Author

Thank you @jcohenadad for the suggestion! It has been added in commit 7fbb42e

@naga-karthik naga-karthik marked this pull request as ready for review August 10, 2023 21:15
@naga-karthik
Copy link
Member Author

Merging as reviewed in a meeting with @valosekj !

@naga-karthik naga-karthik merged commit 0176bb3 into main Aug 11, 2023
@naga-karthik naga-karthik deleted the nk/nnunet-package branch August 11, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants