Who it is forA researcher comparing segmentation results who needs the best available output for a small batch of X-rays and can wait longer per image.
The problemA single forward pass of the flagship model may not give the most reliable masks for difficult images.
The outcomeMasks from the X-High setting, five-model ensemble with 8-pass test-time augmentation, saved to a predictions folder, optionally limited to one label.
What you need first
- Python 3.10 or newer and pip
- One or more X-ray images in PNG, JPEG, TIFF, BMP, or DICOM (DICOM needs the dicom extra)
- Internet access to download pretrained weights from Hugging Face on first run
- For training only: a labeled dataset, and a GPU or CPU for the dry run; the README says training is single-process with at most one GPU
- For the MCP use case: an MCP-capable client such as Claude Code or Claude Desktop
Steps
- Install the package with
python -m pip install flexray. - Run the X-High mode with
flexify --ensemble --tta-samples 8 --input ./image.png --output-dir ./predictions. - To keep one anatomical label only, add
--binary femursto the same command. - Compare the output against the Low mode with
flexify --input ./image.png --output-dir ./predictions_lowand review the masks side by side. (inferred, check the README)
Prompt for your agent
In the FleXray repo, run `flexify --ensemble --tta-samples 8 --input <image-path> --output-dir <output-dir>` on the target X-ray. Expect the same three .npy arrays plus label_names.json. Verify that the mask arrays are uint8 and that the channel count matches label_names.json.
Caveat. The README does not give run-time or accuracy numbers for the modes, so the time cost and quality gain must be measured on your own images.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for VictorButoi/FleXray and "Raise mask quality with the five-model ensemble"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer