Who it is forAn ML engineer at a research group with labeled X-ray masks that use a different set of anatomical labels than the released model.
The problemThe released model predicts its own label protocol, so a custom label set needs a training path that starts from the existing weights.
The outcomeA fine-tuned run that starts from VictorButoi/flexray with a replaced head, checked first with a CPU dry run on the packaged example.
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 training extra with
python -m pip install "flexray[train]". - Scaffold a dataset spec with
fxr-dataset scaffold xray-seg --images ./images --masks ./masks --name MyXrays --output dataset.yml. - Compile the label mapping with
fxr-protocol compile --dataset CustomHips.yml, then pack the data withfxr-dataset pack dataset.yml /data/MyXrays. - Dry-run training on CPU with
fxr-train train_custom.yml --set log.root="$PWD/work/runs" --device cpu --dry-run --smoke-databefore a real run, and add--init-from VictorButoi/flexray --replace-headto start from the released weights. (inferred, check the README)
Prompt for your agent
In the FleXray repo, scaffold a dataset from <images-dir> and <masks-dir> with fxr-dataset, then dry-run fxr-train on CPU with --init-from VictorButoi/flexray --replace-head. Expect a dry run that completes without error and a packed ThunderDB dataset. Verify that the label mapping in the compiled protocol covers every mask id in your data.
Caveat. The released weights are under CC-BY-NC-4.0 unless a model card says otherwise, so a fine-tuned model may carry the same non-commercial limit.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for VictorButoi/FleXray and "Fine-tune Fle Xray onto your own X-ray label set"
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