Metadata-Version: 2.5
Name: flexray-mlx
Version: 0.2.5
Summary: Native MLX implementation of FleXray
Project-URL: Homepage, https://huggingface.co/MedMLX/flexray-mlx
Project-URL: Repository, https://github.com/MedMLX/flexray-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: medmlx-core==0.2.5
Requires-Dist: mlx<1,>=0.32.4
Requires-Dist: numpy<3,>=2.0
Requires-Dist: pillow<14,>=13
Requires-Dist: pydicom<4,>=3
Requires-Dist: pyyaml<7,>=6
Requires-Dist: safetensors<1,>=0.6
Provides-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'
Description-Content-Type: text/markdown

# flexray-mlx

Segment anatomical structures in radiographs with FleXray and native MLX.

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

| Input | Output |
| :--- | :--- |
| Raster image or single-frame DICOM | Structure masks and probabilities |

**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 "flexray-mlx>=0.2.5"
```

## Run

```python
from flexray_mlx.medmlx import run

result = run(image_path="chest.png", output_dir="out")
print(result["outputs"]["mask"])
```

Omitting `weights_path` downloads `MedMLX/flexray-mlx` once and reuses its local cache.
An explicit `weights_path` selects your own model folder, containing `ensemble.json`
and `members/flux0375/{config.yml,label_schema.json,model.safetensors,preprocessing.json}`.
Use `label_name` to select a structure. Automatic setup prepares the flagship
(`ensemble=False`); `ensemble=True` requires all five members in an explicit folder.

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/flexray-mlx/blob/main/LICENSE). See [third-party notices](https://github.com/MedMLX/flexray-mlx/blob/main/THIRD_PARTY_NOTICES.md). Model weights retain their publisher terms. FleXray weights are noncommercial (CC-BY-NC-4.0).

For research and education. Outputs require human review.
