Skip to content
New issue

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

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

Already on GitHub? # to your account

Post-processing not included in run_inference.py #23

Open
plbenveniste opened this issue Jul 11, 2023 · 3 comments
Open

Post-processing not included in run_inference.py #23

plbenveniste opened this issue Jul 11, 2023 · 3 comments
Labels

Comments

@plbenveniste
Copy link
Contributor

plbenveniste commented Jul 11, 2023

After running nnUNetv2_find_best_configuration, I get these instructions :

inference_instructions.txt
***Run inference like this:***

nnUNetv2_predict -d Dataset444_zurich_mouse -i INPUT_FOLDER -o OUTPUT_FOLDER -f  0 1 2 3 4 -tr nnUNetTrainer -c 3d_fullres -p nnUNetPlans

***Once inference is completed, run postprocessing like this:***

nnUNetv2_apply_postprocessing -i OUTPUT_FOLDER -o OUTPUT_FOLDER_PP -pp_pkl_file ./nnUNet_results/Dataset444_zurich_mouse/nnUNetTrainer__nnUNetPlans__3d_fullres/crossval_results_folds_0_1_2_3_4/postprocessing.pkl -np 8 -plans_json ./nnUNet_results/Dataset444_zurich_mouse/nnUNetTrainer__nnUNetPlans__3d_fullres/crossval_results_folds_0_1_2_3_4/plans.json

The current run_inference.pydoesn't perform post-processing. Should we add it ? Is there someone working on this ? (@naga-karthik @valosekj )

Also, I tried running the code on my computer: it took : 1277.31 seconds.
Image is 80 MB (200x200x500) ; (0.05, 0.05, 0.05)
The reason for the length are: I am using 5 folds (so x5 as long) and running on cpu.

I will try to run it after keeping only 1 fold.

@naga-karthik
Copy link
Member

No, I didn't included post-processing as it does not usually improve the performance that much.

About this:

Also, I tried running the code on my computer: it took : 1277.31 seconds.

This is pretty long. Maybe you could only use the checkpoint from one fold only (assuming the results from the other folds does not vary much). Also, a rule of thumb to decide b/w checkpoint_best vs checkpoint_final can be found here

@jcohenadad
Copy link
Member

Also, I tried running the code on my computer: it took : 1277.31 seconds.

😱 This is insanely long. Definitely not "packageable". I hope we can solve this

@plbenveniste
Copy link
Contributor Author

I tried running it on the same image, on 1 fold with best_checkpoint.pth on cpu :
Total time elapsed: 224.46 seconds
On 2 Images : (80 MB and 88.5 MB) both (200;200;500) and (0.05;0.05;0.05)
Total time elapsed: 400.05 seconds

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants