Metadata-Version: 2.5
Name: lung-nodule-mlx
Version: 0.2.4
Summary: MONAI 3D RetinaNet lung nodule detector for Apple Silicon (macOS arm64, Metal)
Project-URL: Homepage, https://huggingface.co/MedMLX/retinanet-lung-nodule-mlx
Author: Joseph Sandoval, Alfredo Sandoval Jr.
License-Expression: Apache-2.0 AND BSD-3-Clause
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: <3.15,>=3.13
Requires-Dist: medmlx-core==0.2.5
Requires-Dist: nibabel<6,>=5.3
Requires-Dist: numpy<3,>=2.0
Provides-Extra: dev
Requires-Dist: hypothesis<7,>=6.140; extra == 'dev'
Requires-Dist: monai==1.6.1; 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'
Requires-Dist: torch<2.14,>=2.13; extra == 'dev'
Requires-Dist: torchvision<0.29,>=0.28; extra == 'dev'
Description-Content-Type: text/markdown

# lung-nodule-mlx

Detect lung nodule candidates in 3D chest CT with MONAI RetinaNet and native MLX.

[Docs](https://github.com/MedMLX/lung-nodule-mlx/blob/main/docs/technical.md) · [Model weights](https://huggingface.co/MedMLX/retinanet-lung-nodule-mlx) · [MedMLX](https://github.com/MedMLX)

| Input | Output |
| :--- | :--- |
| 3D chest CT · NIfTI | Candidate boxes and scores in RAS mm |

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

## Install

```bash
uv venv --python 3.13
source .venv/bin/activate
uv pip install "lung-nodule-mlx>=0.2.3"
```

## Run

```python
from lung_nodule_mlx.medmlx import run

result = run(image_path="ct.nii.gz", output_dir="out", resample_raw_input=True)
print(result["outputs"]["detections"])
```

Omitting `weights_path` downloads `MedMLX/retinanet-lung-nodule-mlx` once and reuses
its local cache. An explicit model folder contains `network.safetensors`.
Box selection uses NumPy and requires no compiler or Xcode installation.

Keep `resample_raw_input=True` for ordinary CT. The runner also accepts an explicit
checkpoint file. Tied scores are ordered by original index, so overlapping boxes
can differ from MONAI runs when scores tie.

Downloaded commits are returned in `details.weights_revision`; explicit local
weights report `null` unless the folder carries a MedMLX download revision.

## License

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

For research and education. Outputs require human review.
