nnInteractive (fastforks)
nnInteractive (Isensee et al. 2025): DKFZ's promptable 3D segmentation for CT, MRI, PET and 3D microscopy. Point, box (2D or 3D) and scribble prompts, positive or negative, refine one object mask in a session; a ResEnc-L U-Net on 192Β³ patches with AutoZoom (zooms out up to 4x while the mask grows past the patch, then refines the changed region at full resolution). Lasso prompts and initial masks are not ported.
This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: https://github.com/kleinicke/fastforks. Kernels for the kernels backend: https://huggingface.co/fastforks/kernels. Original code: https://github.com/MIC-DKFZ/nnInteractive at 6bf57adf42ca.
Author weight repos: https://huggingface.co/MIC-DKFZ/nnInteractive.
Task: volume. Tier: experimental. Outputs: mask. Backends: portable, kernels.
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). Encoder models (nnFoundation) take a CT or MRI volume and give its encoder feature maps.
Variants
Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in card.toml.
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|---|---|---|---|---|
nninteractive@1 |
nnInteractive_v1.0/plans.json nnInteractive_v1.0/fold_0/checkpoint_final.pth |
64a30a430438b3ac4421f854 |
CC-BY-NC-SA-4.0 | no |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: LICENSE.
Training data: 120+ volumetric 3D datasets (CT, MRI, PET, 3D microscopy; readme) with simulated prompts..
Licence evidence: https://huggingface.co/MIC-DKFZ/nnInteractive/blob/3f308d751c00644e4fde6f09c600264b393b21b5/nnInteractive_v1.0/LICENSE ; https://github.com/MIC-DKFZ/nnInteractive/blob/master/LICENSE
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): nninteractive 512x512x512 voxels (5.7 GiB peak allocated, 6.1 reserved)
Speed and memory
Volume, synthetic
| model | input | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|---|
nninteractive |
200x200 | 705 | 460 | 215 | 201 | 2.3x | 1.1x | 4076 / 4636 | 3075 / 3492 | 2643 / 3072 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
nninteractive |
3.23 | 1.09 | 0.65 | 1.04 | 0.48 | 0.40 |
torch.compile and TensorRT
| model | input | time: portable | compile | TensorRT fp16 | kernels | preparation: compile (cold first call) | ONNX + engine build | peak MiB (alloc / reserved): portable | compile | kernels | TensorRT (engine + torch) |
|---|---|---|---|---|---|---|---|---|---|---|---|
nninteractive |
200x200 | 215 ms | planned for 0.2.1 | planned for 0.2.1 | 201 ms | β | β | 3075 / 3492 | β | 2643 / 3072 | β |
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
Hardware, protocol and caveats: benchmarks (RTX 5060 Ti 16 GB, sm_120). Original = the original code named above at the precision of portable (fp16, or (fp32) where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.
Accuracy
Parity with the original code
Every variant is checked against reference outputs of the original code at its pinned commit. 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 mask).
Usage
from fastforks import volume
# non-commercial weights: run with FASTFORKS_NONCOMMERCIAL=1 in the environment
model = volume.load("nninteractive") # mode="auto": the preferred backend from recorded measurements
result = model(volume, point=(z, y, x)) # volume: [D, H, W] float32 CT/MRI/PET; or box= / scribble=
result.mask # [D, H, W] bool; model.session(volume).add_point(...) refines one object step by step
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
Install with pip install fastforks (see https://github.com/kleinicke/fastforks). Other variants: nninteractive.
Kernels backend
volume.load("nninteractive", mode="kernels") runs our CUDA kernels (vol_norm). It needs a prebuilt kernel for your GPU architecture (downloaded from https://huggingface.co/fastforks/kernels on first use) and a recent NVIDIA driver; if there is none it raises BackendUnavailableError with the reason and never falls back silently. mode="auto" picks kernels when it can run and logs the choice.
Model tree for fastforks/nninteractive
Base model
MIC-DKFZ/nnInteractive