- Setup nnU-Net as described here
- Download the data
- Convert the data to nnU-Net format using
resources/convert_dataset_to_nnunet.py
(seeresources/train_nnunet.sh
for usage example) - Preprocess
nnUNetv2_plan_and_preprocess -d <your_dataset_id> -pl ExperimentPlanner -c 3d_fullres -np 2
- Train
nnUNetv2_train <your_dataset_id> 3d_fullres 0 -tr nnUNetTrainerNoMirroring
(takes several days) - Predict test set
nnUNetv2_predict -i path/to/imagesTs -o path/to/labelsTs_predicted -d <your_dataset_id> -c 3d_fullres -tr nnUNetTrainerNoMirroring --disable_tta -f 0
- Evaluate
python resources/evaluate.py path/to/labelsTs path/to/labelsTs_predicted
(requirespip install git+https://github.com/google-deepmind/surface-distance.git
andpip install p_tqdm
). The resulting numbers should be similar to the ones inresources/evaluate_results.txt
(since training is not deterministic the mean dice score across all classes can vary by up to one dice point) - Done
Note: This will not give you the same results as TotalSegmentator for two reasons:
- TotalSegmentator v2 uses a bigger dataset which is not completely public
- TotalSegmentator is trained on images without blurred faces. Your dataset contains blurred faces.