Totalsegmentator Mini is a small-scale clone of Totalsegmentator, a tool that utilizes the MONAI deep learning framework to perform semantic segmentation on medical images. This tool can be used for both inference and training tasks.
This model was trained on the TotalSegmentator dataset as well as on 3500 additional abdominal CT scans, which were first segmented by the full TotalSegmentator model.
python -m monai.bundle run inference \
--meta_file configs/metadata.json \
--config_file configs/inference.yaml \
--logging_file configs/logging.conf \
--dataset_dir <path_to_file_or_folder>
To run inference on a single file or a directory containing multiple image files use the --dataset_dir
flag.
Nested directories are not supported.
To control where the files are stored, overwrite the output directory with the --output_dir
flag.
Evaluate the model on the official total segmentator training data (you need to download the data and adapt the paths beforehand).
python -m monai.bundle run evaluating \
--meta_file configs/metadata.json \
--config_file configs/evaluate.yaml \
--logging_file configs/logging.conf
During training, this bundle saves both, the model weights AND the optimizer in model.pt
. This can be an issue, e.g. if deployed in MONAI Label. Use scripts/separate_model_optim.py
to separate them.
python -m monai.bundle run training \
--meta_file configs/metadata.json \
--config_file "['configs/train.yaml','configs/unet.yaml']" \
--logging_file configs/logging.conf
torchrun --nnodes=1 --nproc_per_node=8 -m monai.bundle run training \
--meta_file configs/metadata.json \
--config_file "['configs/train.yaml','configs/unet.yaml','configs/multi_gpu_train.yaml']" \
--logging_file configs/logging.conf
By using Totalsegmentator Mini, you can perform semantic segmentation on medical images in a quick and efficient manner.