FlexibleUNet · Endoscopy
Segment surgical tools in RGB endoscopy frames with an EfficientNet-B2 FlexibleUNet.
This checkpoint is the MONAI Consortium's
endoscopic_tool_segmentationbundle, built on the U-Net of Olaf Ronneberger and co-authors and the EfficientNet encoder of Mingxing Tan and Quoc V. Le. The model and the weights are theirs: see the original repository, Project-MONAI/model-zoo, and the papers, U-Net and EfficientNet. This repository only repackages the released bundle (MONAI/endoscopic_tool_segmentation) for MLX on Apple Silicon. Please cite their papers and star their repository if FlexibleUNet is useful to you.
Original repository · Original papers · Original weights · GitHub · Files · Docs · MedMLX paper
| Input | Output |
|---|---|
| RGB endoscopy frame | Full-resolution tool mask |
Apple Silicon · Metal · Python 3.13
Quick start
uv venv --python 3.13
source .venv/bin/activate
uv pip install "flexible-unet-mlx>=0.3.0"
Replace the example input paths with your own files.
from flexible_unet_mlx import run
result = run(image_path="frame.jpg", output_dir="outputs")
print(result["outputs"]["mask"])
Weights download from this repository on first use, at a pinned revision. To fetch them yourself, download that revision and pass the folder as weights_path="models":
uv tool install huggingface-hub
hf download MedMLX/flexible-unet-effnetb2-mlx --revision ccbbc596f2a9da8477e25cba0d7548cbb2191feb --local-dir models
Use & license
For research and education. Not validated for clinical use.
Weights: Apache-2.0. Notices.
Paper references
- Decoder architecture: U-Net: Convolutional Networks for Biomedical Image Segmentation.
- Encoder architecture: EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks.
Citation
Please cite the original papers:
Ronneberger, O. et al. (2015). U-Net: Convolutional Networks for Biomedical Image Segmentation. arXiv:1505.04597.
Tan, M. & Le, Q. V. (2019). EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. arXiv:1905.11946.
If you use MedMLX, please cite the MedMLX paper:
@article{sandoval2026medmlx,
title = {MedMLX: On-Device Medical Imaging AI for Apple Silicon},
author = {Sandoval, J. and Sandoval, A. and Saleem, A.},
journal = {medRxiv},
year = {2026},
doi = {10.64898/2026.10.28.26366762}
}