Metadata-Version: 2.5
Name: nnunet-mlx
Version: 0.5.2
Summary: MLX-native nnU-Net v2 inference on Apple Silicon
Project-URL: Repository, https://github.com/MedMLX/nnunet-mlx
Project-URL: Issues, https://github.com/MedMLX/nnunet-mlx/issues
Project-URL: Documentation, https://github.com/MedMLX/nnunet-mlx/tree/main/docs
Author: Joseph Sandoval
License-Expression: Apache-2.0 AND MIT
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Keywords: apple-silicon,image-segmentation,medical-imaging,mlx,nnunet
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: <3.15,>=3.13
Requires-Dist: blosc2<5,>=3.3.2
Requires-Dist: imagecodecs<2027,>=2025
Requires-Dist: medmlx-core==0.2.4
Requires-Dist: mlx==0.32.4; platform_system == 'Darwin' and platform_machine == 'arm64'
Requires-Dist: nibabel<6,>=5.3
Requires-Dist: numpy<3,>=2.0
Requires-Dist: pillow<14,>=13.0.0
Requires-Dist: safetensors<1,>=0.6
Requires-Dist: scikit-image==0.26.0
Requires-Dist: scipy==1.18.1
Requires-Dist: simpleitk==2.5.6
Requires-Dist: tifffile<2027,>=2025
Requires-Dist: typer==0.27.1
Provides-Extra: conversion
Requires-Dist: torch==2.13.0; extra == 'conversion'
Provides-Extra: dev
Requires-Dist: hypothesis<7,>=6; extra == 'dev'
Requires-Dist: matplotlib<4,>=3.10; extra == 'dev'
Requires-Dist: pyright==1.1.414; extra == 'dev'
Requires-Dist: pytest<10,>=8.4; extra == 'dev'
Requires-Dist: ruff<1,>=0.13; extra == 'dev'
Provides-Extra: oracle
Requires-Dist: dynamic-network-architectures==0.4.4; extra == 'oracle'
Requires-Dist: nnunetv2==2.8.1; extra == 'oracle'
Requires-Dist: torch==2.13.0; extra == 'oracle'
Requires-Dist: urllib3<3,>=2.8; extra == 'oracle'
Description-Content-Type: text/markdown

# nnunet-mlx

Run pretrained nnU-Net v2 models locally on Apple Silicon with native MLX.

[Docs](https://github.com/MedMLX/nnunet-mlx/blob/main/docs/technical.md) · [Supported models](https://github.com/MedMLX/nnunet-mlx/blob/main/docs/compatibility.md) · [MedMLX](https://github.com/MedMLX)

![nnunet-mlx example output](https://raw.githubusercontent.com/MedMLX/nnunet-mlx/main/docs/example.png)

*nnU-Net liver model on an AMOS22 CT (left) and BraTS model on a Medical Segmentation Decathlon MRI (right).*

| Input | Output |
| :--- | :--- |
| NIfTI channels + model folder | Segmentation and optional probabilities |

**Apple Silicon · Metal · Python 3.13 / 3.14** · [uv](https://docs.astral.sh/uv/)

## Quick start

```bash
uv venv --python 3.13
source .venv/bin/activate
uv pip install "nnunet-mlx[conversion]"
```

Convert a trusted nnU-Net v2 model folder, then predict:

```bash
nnunet-mlx convert model-folder \
  --source-model-folder /path/to/upstream-model \
  --output-model-folder mlx-model
```

```bash
nnunet-mlx model predict \
  --model-folder mlx-model \
  --input case_0000.nii.gz \
  --output-prefix predictions/case
```

Supports 2D and 3D PlainConvUNet and ResidualEncoderUNet. Supply input channels in the model’s expected order.

## License

[Apache-2.0](https://github.com/MedMLX/nnunet-mlx/blob/main/LICENSE). See [third-party notices](https://github.com/MedMLX/nnunet-mlx/blob/main/THIRD_PARTY_NOTICES.md). Model weights retain their publisher terms.

For research and education. Outputs require human review.
