rf-detr.cpp Model Manifest

July 30, 2026 ยท View on GitHub

The five detection variants were generated 2026-05-27 from rfdetr 1.7.0 checkpoints. All six segmentation variants were re-generated 2026-07-30 from rfdetr 1.9.0 checkpoints, after the segmentation-head block-count fix. Every model is converted with scripts/convert_rfdetr_to_gguf.py (F32) and re-quantized in-place by the C++ quantizer (build/bin/rfdetr-cli quantize). Re-running the steps below today converts from rfdetr 1.9.0 throughout, since that is what scripts/requirements.txt pins.

The .gguf files themselves are gitignored; this manifest is the canonical record of what should exist and at what size. To rebuild from scratch:

# 1. Convert PyTorch -> F32 GGUF (one per variant)
for v in nano small base medium large \
         seg-nano seg-small seg-medium seg-large seg-xlarge seg-2xlarge; do
    scripts/convert_rfdetr_to_gguf.py --variant "$v" --dtype f32 \
        --output "models/rfdetr-${v}-f32.gguf"
done

# 2. Materialize F16, Q8_0, Q4_K for every F32 source
scripts/build_all_quants.sh

All 44 models were verified to load and run rfdetr-cli detect without error at the time they were generated, and all 44 are current: the 16 stale segmentation files described in earlier revisions of this manifest have been replaced.

Detection variants

VariantF32F16Q8_0Q4_K
Nano112.7 MB60.5 MB36.0 MB29.7 MB
Small119.0 MB64.0 MB38.2 MB31.2 MB
Base119.2 MB64.2 MB38.5 MB31.5 MB
Medium125.0 MB67.2 MB40.2 MB32.5 MB
Large125.9 MB68.2 MB41.1 MB33.4 MB

Segmentation variants

VariantF32F16Q8_0Q4_K
Seg-Nano127.1 MB67.8 MB39.9 MB31.8 MB
Seg-Small127.6 MB68.3 MB40.4 MB32.4 MB
Seg-Medium133.9 MB71.6 MB42.5 MB33.6 MB
Seg-Large134.6 MB72.3 MB43.1 MB34.3 MB
Seg-XLarge141.9 MB76.7 MB46.1 MB36.6 MB
Seg-2XLarge143.9 MB78.7 MB48.2 MB38.6 MB

Sizes are as measured on the files that are published, in MiB, and they are the post-fix sizes: seg-medium, seg-large, seg-xlarge and seg-2xlarge each carry one or two more DepthwiseConvBlocks than the GGUFs originally published for them (one per decoder layer, so 5 for medium/large and 6 for xlarge/2xlarge, instead of a hardcoded 4). All six segmentation variants have now been re-converted from rfdetr 1.9.0 and re-published, and the loader rejects any surviving copy of an old short-block file with an explanatory error.

A second, unrelated defect lived in the C++ two-stage module rather than in the weights: it omitted upstream's gen_encoder_output_proposals validity mask until commit d256d3e. That mask can only fire on a patch grid of side 50 or more, which means seg-xlarge (grid 52) and seg-2xlarge (grid 64) and no other variant. It changed no GGUF, so nothing here needed re-converting on its account; see docs/conversion.md.

Quant choice notes

  • F32: full precision reference, about 120 MB per variant.
  • F16: only matmul-multiplicand weights converted; non-matmul tensors (norms, conv kernels, embeddings) stay F32. Loader handles F16 pos_embed via bicubic resample in F32 (see commit 2145c7d).
  • Q8_0: best accuracy/size trade for production; about 3x smaller than F32.
  • Q4_K: smallest practical quant; rows with ne[0] % 256 != 0 (the decoder's 128-dim MLP halves, 60 tensors) silently fall back to Q8_0 per the C++ quantizer's logic. Net result is still about 3.8 to 4.0x compression.

Heavier K-quants (Q5_K, Q6_K) and the older legacy quants (Q4_0/Q4_1/Q5_0/Q5_1) are supported by rfdetr-cli quantize but are not part of the standard matrix; generate on demand if needed.