TotalSegmentator-KonfAI
KonfAI-accelerated adaptation of TotalSegmentator β whole-body multi-organ CT / MRI segmentation, built with KonfAI.
π§© Models
| Task | Modality | Labels | Ensemble | Notes |
|---|---|---|---|---|
total |
CT | 117 | 5 | full accuracy |
total-3mm |
CT | 117 | 1 | fast (3 mm) |
total_mr |
MRI | 50 | 2 | |
total_mr-3mm |
MRI | 50 | 1 | fast (3 mm) |
3D residual UNet Β· patch [96, 128, 160] Β· resampled to 1.5 mm.
π Usage
pip install totalsegmentator-konfai
totalsegmentator-konfai segment total -i input_ct.nii.gz -o output/
- Generic runner:
konfai-apps infer VBoussot/TotalSegmentator-KonfAI:total -i input_ct.nii.gz -o output/ - Interactive: SlicerKonfAI β the β Advanced dialog overrides patch size and batch size.
β‘ Performance & VRAM
Benchmarked on a single NVIDIA RTX PRO 5000 (24 GB) with a real whole-body CT (295 Γ 259 Γ 219, 2 mm), full 5-model ensemble (total), half precision (autocast). The batch size is auto-selected from your free GPU VRAM.
| Free VRAM | Batch (auto) | Peak VRAM | Time / case |
|---|---|---|---|
| 8 GB | 2 | β | β |
| 16 GB | 4 | β | β |
| 24 GB | 4 | ~20 GB | ~42 s |
The 5-model total head (117 classes) needs ~20 GB of VRAM for its forward pass, so the ensemble targets a 24 GB card; on smaller cards use total-3mm (1 model, 3 mm). Its whole-volume accumulator is too large for the GPU, so reassembly runs on the host (system RAM ~19 GB). A larger batch saturates the card and slows inference. Override with --patch-size / --batch-size.
vs the original TotalSegmentator (same case, single 24 GB card): ~42 s for KonfAI vs ~76 s for the original β ~1.8Γ faster.
π Links
- π§ Original TotalSegmentator: github.com/wasserth/TotalSegmentator
- π§ KonfAI: github.com/vboussot/KonfAI
- π¦ PyPI: totalsegmentator-konfai