Models · 3D volume segmentation

TotalSegmentator

TotalSegmentator (University Hospital Basel): nnU-Net v2 networks that label 117 anatomical structures (organs, bones, muscles, vessels) in CT volumes, at 1.5 mm (five networks) or 3 mm (one, faster). Commercially usable (Apache-2.0 code and weights).

experimental Fork of wasserth/TotalSegmentator@184fa47 · backends: portable, kernels

Checkpoint

Paper 2023 Added in 0.2.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 1740 ms 200x200, fp16
vs the faster original 26.2× original fp16: 45630 ms
Peak memory 2,349 MiB original: 2,640 MiB
Accuracy vs original fp32 – original not run on the test set

Use it

pip install fastforks

Lean install with only what this model needs: pip install fastforks-core

from fastforks import volume

model = volume.load("totalsegmentator-total")  # kernels on a supported GPU, else portable PyTorch
result = model(volume, spacing)
result.labels
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench totalsegmentator-total

Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.

Speed and memory

Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.

Input: synthetic, 200x200 (the task’s standard size)

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32totalsegmentator(nifti, ml=True, fast=False, device='gpu') on the in-memory NIfTI (CPU numpy in, labels out; weights load per call as upstream)fp32 477790.96×8,150 MiB/8,604 MiB0.155.49
Original fp16totalsegmentator(nifti, ml=True, fast=False, device='gpu') on the in-memory NIfTI (CPU numpy in, labels out; weights load per call as upstream)fp16 45630–2,640 MiB/2,874 MiB0.154.51
Portable fp32fp32not measured ––––
Portablefp16 192724×2,605 MiB/2,944 MiB0.82.10
Kernelsfp16 174026×2,349 MiB/2,704 MiB0.81.88
Portable + torch.compileno exportable module (multi-network sliding-window pipeline)fails––––
TensorRTno exportable module (multi-network sliding-window pipeline;fails––––

Measured on RTX 5060 Ti 16 GB, torch 2.10.0+cu130, 2.14.1+cu130, 2026-11-14. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.

Other devices

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-15Originalfp32cannot run here–200x200
Portablefp1623070 6,058 MiB processmatches200x200
Portablefp3227804 10,180 MiB processmatches200x200
Kernelsfp16not implemented–200x200

CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.

Licence and weights

Commercial use allowed

Code
Apache-2.0 LICENSE
Weights
Apache-2.0 source
Training data

Our reading of the licences, not legal advice.

Weights

Dataset291_TotalSegmentator_part1_organs_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/plans.json 11.2 KB· inside a 234 MB archive· hosted on GitHub
Dataset291_TotalSegmentator_part1_organs_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/dataset.json 1.0 KB· inside a 234 MB archive· hosted on GitHub
Dataset291_TotalSegmentator_part1_organs_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/fold_0/checkpoint_final.pth 252 MB· inside a 234 MB archive· hosted on GitHub
Dataset292_TotalSegmentator_part2_vertebrae_1532subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/plans.json 11.2 KB· inside a 234 MB archive· hosted on GitHub
Dataset292_TotalSegmentator_part2_vertebrae_1532subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/dataset.json 1.1 KB· inside a 234 MB archive· hosted on GitHub
Dataset292_TotalSegmentator_part2_vertebrae_1532subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/fold_0/checkpoint_final.pth 252 MB· inside a 234 MB archive· hosted on GitHub
Dataset293_TotalSegmentator_part3_cardiac_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/plans.json 11.2 KB· inside a 234 MB archive· hosted on GitHub
Dataset293_TotalSegmentator_part3_cardiac_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/dataset.json 974 B· inside a 234 MB archive· hosted on GitHub
Dataset293_TotalSegmentator_part3_cardiac_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/fold_0/checkpoint_final.pth 251 MB· inside a 234 MB archive· hosted on GitHub
Dataset294_TotalSegmentator_part4_muscles_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/plans.json 11.2 KB· inside a 234 MB archive· hosted on GitHub
Dataset294_TotalSegmentator_part4_muscles_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/dataset.json 1.0 KB· inside a 234 MB archive· hosted on GitHub
Dataset294_TotalSegmentator_part4_muscles_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/fold_0/checkpoint_final.pth 252 MB· inside a 234 MB archive· hosted on GitHub
Dataset295_TotalSegmentator_part5_ribs_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/plans.json 11.2 KB· inside a 234 MB archive· hosted on GitHub
Dataset295_TotalSegmentator_part5_ribs_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/dataset.json 1.0 KB· inside a 234 MB archive· hosted on GitHub
Dataset295_TotalSegmentator_part5_ribs_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres/fold_0/checkpoint_final.pth 252 MB· inside a 234 MB archive· hosted on GitHub

fastforks downloads and checks these files on first use (fastforks download totalsegmentator-total).

Accuracy

The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.

TotalSegmentator test subset (7 CT cases)

1.5 mm, mean Dice

Rundtypedice ↑casesms / case
Original fp32not measured
Original fp16fp160.9365 7 –
Portable fp32not measured
Portablefp160.9365 7 –
Kernelsfp160.9365 7 –

The original code was not run on this dataset, so the table cannot show the distance to it.

A small subset of real CT cases of the TotalSegmentator dataset (not the full test split), each run at its card's spacing (1.5 or 3 mm) in the same pipeline; mean over the cases of the Dice (0 to 1) averaged over the classes present, against the ground-truth segmentations (vertebrae_L6 of the subset has no counterpart and is skipped). Original = TotalSegmentator 2.18.0, default fp16 autocast. Original = the authors’ code, same checkpoint and protocol. Measured on original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-14; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 2d71f180, 2026-11-14.

Closeness to the original

Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.0 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.003 and p99 <= 0.5 (absolute error of the output labels).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0 not recorded
cpu_label_mismatch≤ 0.001 not recorded
GPU default dtypes, mean |diff|≤ 0.003 0.00007
GPU default dtypes, p99 |diff|≤ 0.5 0

Recorded for totalsegmentator-total on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-14, with these kernels: vol_norm

Details

TotalSegmentator (Wasserthal et al., Radiology: AI 2023): 117 anatomical structures (organs, bones, muscles, vessels) in CT, from nnU-Net v2 3D U-Nets. `total` merges five 1.5 mm part networks, `total-3mm` is the single fast 3 mm network. Gives one integer label volume on the input grid plus the label names.

Input / output
Input: a CT volume [D, H, W] in Hounsfield units and its voxel spacing in mm (volume.read_nifti reads both from a NIfTI file). Output: a class index per voxel [D, H, W] on the input grid (0 = background).
What the numbers mean, and which models need the camera focal length

Encoder models (nnFoundation) take a CT or MRI volume and give its encoder feature maps. For a trained nnU-Net v2 folder or checkpoint, see the [nnU-Net v2 loader](../api/volume.md#nnu-net-v2).

Input size
any H x W >= 32, padded to a multiple of 32; tested up to 512x512 (5,635 MiB allocated)
Outputs
labels
Checkpoint
parts=["Dataset291_TotalSegmentator_part1_organs_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres","Dataset292_TotalSegmentator_part2_vertebrae_1532subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres","Dataset293_TotalSegmentator_part3_cardiac_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres","Dataset294_TotalSegmentator_part4_muscles_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres","Dataset295_TotalSegmentator_part5_ribs_1559subj/nnUNetTrainerNoMirroring__nnUNetPlans__3d_fullres"], spacing=1.5
CUDA kernels
  • vol_norminstance norm and LeakyReLU on 3D volumes
Apple (MPS)
fp32, fp16
Full reference, generated from the repository

TotalSegmentator (University Hospital Basel): nnU-Net v2 networks that label 117 anatomical structures (organs, bones, muscles, vessels) in CT volumes, at 1.5 mm (five networks) or 3 mm (one, faster). Commercially usable (Apache-2.0 code and weights).

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
totalsegmentator-totalsynthetic (200x200)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
47779
45630
1927
1740
fails: no exportable module (multi-network sliding-window pipeline)
fails: no exportable module (multi-network sliding-window pipeline;
8150 / 8604
2640 / 2874
2605 / 2944
2349 / 2704
–
–
totalsegmentator-total-3mmsynthetic (200x200)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
7304
7270
67.1
63.5
fails: no exportable module (multi-network sliding-window pipeline)
fails: no exportable module (multi-network sliding-window pipeline;
5358 / 5698
2010 / 2684
1092 / 1508
1037 / 1410
–
–
Details
  • Original code: https://github.com/wasserth/TotalSegmentator at 184fa4765456
  • Code licence: Apache-2.0 (permissive); files: LICENSE
  • Weights licence: Apache-2.0
  • Licence evidence: https://github.com/wasserth/TotalSegmentator/blob/184fa4765456492b2ab81a981cc387465906b003/LICENSE ; https://github.com/wasserth/TotalSegmentator/blob/184fa4765456492b2ab81a981cc387465906b003/README.md
  • Training data: TotalSegmentator dataset v2 (1228 CT scans, 117 structures) (1559 CT scans of the TotalSegmentator dataset v2 (CC BY 4.0). Only the weights licence counts for the commercial flag.)
  • Kernel libraries: vol_norm
  • Variants: totalsegmentator-total, totalsegmentator-total-3mm
  • Outputs: labels
  • Input size: any D x H x W volume and its voxel spacing (resampled to the model spacing, sliding window)
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): totalsegmentator-total 512x512x512 voxels (5.5 GiB peak allocated, 5.8 reserved); totalsegmentator-total-3mm 512x512x512 voxels (4.3 GiB peak allocated, 5.1 reserved)
  • totalsegmentator-total original (fp32) 200x200, original 200x200: totalsegmentator(nifti, ml=True, fast=False, device='gpu') on the in-memory NIfTI (CPU numpy in, labels out; weights load per call as upstream)
  • totalsegmentator-total-3mm original (fp32) 200x200, original 200x200: totalsegmentator(nifti, ml=True, fast=True, device='gpu') on the in-memory NIfTI (CPU numpy in, labels out; weights load per call as upstream)
  • totalsegmentator-total load / first call: original 0.07 s / 54.51 s, portable 0.77 s / 2.103 s, kernels 0.77 s / 1.879 s
  • totalsegmentator-total-3mm load / first call: original 0.06 s / 12.48 s, portable 1.18 s / 0.259 s, kernels 1.19 s / 0.209 s
  • Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5

Measured

A small subset of real CT cases of the TotalSegmentator dataset (not the full test split), each run at its card's spacing (1.5 or 3 mm) in the same pipeline; mean over the cases of the Dice (0 to 1) averaged over the classes present, against the ground-truth segmentations (vertebrae_L6 of the subset has no counterpart and is skipped). Original = TotalSegmentator 2.18.0, default fp16 autocast. Original = the original code named under Details, same checkpoint and protocol.

variantdatasetoriginal fp16portablekernelsnote
totalsegmentator-totalTotalSegmentator test subset (7 CT cases), 1.5 mm, mean Dice0.93650.93650.9365
totalsegmentator-total-3mmTotalSegmentator test subset (8 CT cases), 3 mm, mean Dice0.82850.82850.8285

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 2d71f180, 2026-11-14.

Parity

CPU, float32: max |diff| <= 0.0 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.003 and p99 <= 0.5 (absolute error of the output labels).

variantkernels error vs original, mean / p99GPU, torchkernels used
totalsegmentator-total7e-05 / 0.0RTX 5060 Ti, torch 2.14.1+cu130vol_norm@44036d4da567:sm_120
totalsegmentator-total-3mm0.0006 / 0.0RTX 5060 Ti, torch 2.14.1+cu130vol_norm@44036d4da567:sm_120

Example output

No example rendered for this checkpoint yet.