DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to fine-tune Fle Xray onto your own X-ray label set with Fle Xray

Map your masks to the Fle Xray protocol, pack the data, and train from the released weights.

Short answer: Install the training extra with python -m pip install "flexray[train]"; then 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 with fxr-dataset pack dataset.yml /data/MyXrays. All steps.

  • Research
  • Advanced
  • 3 hours
  • From the README
  • Any agent

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

  1. Install the training extra with python -m pip install "flexray[train]".
  2. Scaffold a dataset spec with fxr-dataset scaffold xray-seg --images ./images --masks ./masks --name MyXrays --output dataset.yml.
  3. Compile the label mapping with fxr-protocol compile --dataset CustomHips.yml, then pack the data with fxr-dataset pack dataset.yml /data/MyXrays.
  4. Dry-run training on CPU with fxr-train train_custom.yml --set log.root="$PWD/work/runs" --device cpu --dry-run --smoke-data before a real run, and add --init-from VictorButoi/flexray --replace-head to 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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer