Metadata-Version: 2.5
Name: flexible-unet-mlx
Version: 0.2.3
Summary: Native FP32 MLX FlexibleUNet released-checkpoint network
Project-URL: Homepage, https://huggingface.co/MedMLX/flexible-unet-effnetb2-mlx
Author: Joseph Sandoval, Alfredo Sandoval Jr.
License-Expression: Apache-2.0
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: numpy<3,>=2.0
Requires-Dist: pillow<14,>=13
Provides-Extra: dev
Requires-Dist: hypothesis<7,>=6.140; extra == 'dev'
Requires-Dist: mlx==0.32.4; (platform_machine == 'arm64' and sys_platform == 'darwin') and 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: safetensors<1,>=0.6; extra == 'dev'
Requires-Dist: torch<2.14,>=2.13; extra == 'dev'
Description-Content-Type: text/markdown

# flexible-unet-mlx

Segment surgical tools in RGB endoscopy frames with FlexibleUNet and native MLX.

[Model weights](https://huggingface.co/MedMLX/flexible-unet-effnetb2-mlx)

| Input | Output |
| :--- | :--- |
| RGB image | Tool mask at the original size |

**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 "flexible-unet-mlx>=0.2.3"
```

```python
from flexible_unet_mlx.medmlx import run

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

Omitting `weights_path` downloads `MedMLX/flexible-unet-effnetb2-mlx` once and reuses
its local cache. To use your own model folder, pass `weights_path="/path/to/model"`;
the runtime finds `flexibleunet.safetensors` inside it. Explicit checkpoint-file
paths remain accepted by the standalone runtime.

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.

For research and education. Outputs require human review.
