Metadata-Version: 2.5
Name: biomedparse-mlx
Version: 0.1.3
Summary: Native MLX inference for BioMedParse v2 on Apple Silicon
Project-URL: Homepage, https://huggingface.co/MedMLX/biomedparse-v2-mlx
Author: Joseph Sandoval, Alfredo Sandoval Jr.
License-Expression: Apache-2.0 AND MIT AND BSD-3-Clause
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Classifier: Operating System :: MacOS :: MacOS X
Requires-Python: <3.15,>=3.13
Requires-Dist: huggingface-hub<2,>=1
Requires-Dist: medmlx-core==0.2.5
Requires-Dist: nibabel<6,>=5.3
Requires-Dist: numpy<3,>=2
Requires-Dist: pillow<14,>=13
Requires-Dist: pydicom<4,>=3
Requires-Dist: scikit-image<1,>=0.25
Requires-Dist: tokenizers<0.23,>=0.22
Provides-Extra: assets
Requires-Dist: huggingface-hub<2,>=1; extra == 'assets'
Provides-Extra: dev
Requires-Dist: hypothesis<7,>=6.140; 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: fvcore>=0.1.5; extra == 'oracle'
Requires-Dist: hydra-core<2,>=1.3.8; extra == 'oracle'
Requires-Dist: safetensors<1,>=0.6; extra == 'oracle'
Requires-Dist: simpleitk<3,>=2.4; extra == 'oracle'
Requires-Dist: timm<2,>=1; extra == 'oracle'
Requires-Dist: torch<3,>=2.6; extra == 'oracle'
Requires-Dist: transformers<6,>=5; extra == 'oracle'
Description-Content-Type: text/markdown

# biomedparse-mlx

Segment 3D medical images from text prompts with Microsoft BioMedParse v2 and native MLX.

[Model weights](https://huggingface.co/MedMLX/biomedparse-v2-mlx)

| Input | Output |
| :--- | :--- |
| Medical image + text prompts | Labeled segmentation |

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

## Quick start

```bash
uv pip install "biomedparse-mlx>=0.1.3"
```

```python
from biomedparse_mlx.medmlx import run

result = run(
    image_path="scan.npy",
    prompt="Visualization of the liver in abdominal CT imaging",
    labels=[6],
    output_dir="outputs/liver",
)
print(result["outputs"]["mask"])
```

Omitting `weights_path` downloads `MedMLX/biomedparse-v2-mlx` once and reuses its local
cache. The runtime finds `biomedparse-v2.safetensors` and `tokenizer.json` inside that
folder. An explicit `weights_path` selects your own folder; standalone checkpoint
files and an explicit `tokenizer_path` remain supported.

Prepared arrays use the 0–255 intensity range. Raw NIfTI and DICOM require
`modality`, with `ct_site` for CT.

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; license and third-party notices are included in the distribution. Model weights retain their publisher terms. BioMedParse weights are CC-BY-NC-SA-4.0.

For research and education. Outputs require human review.
