LibreLWDETRs
LW-DETR-small (14.6M params, 16.6 GFLOPs, 48.0 AP on COCO val2017), repackaged for LibreYOLO.
LW-DETR pairs a plain-ViT encoder using interleaved window/global attention with a multi-scale projector and a shallow deformable DETR decoder. It is NMS-free at inference, and it is the architecture RF-DETR was later forked from.
from libreyolo import LibreYOLO
model = LibreYOLO("LibreLWDETRs.pt") # downloads from this repo
results = model.predict("image.jpg")
Inference-only in LibreYOLO: upstream's Group-DETR one-to-many training recipe
is not implemented, so model.train(...) raises. Input side must be a multiple
of 64 (the encoder tiles the patch grid into 4x4 windows); the default is 640.
Source
Derived from Atten4Vis/LW-DETR
(paper: arXiv 2406.03459), from the COCO
checkpoint LWDETR_small_60e_coco.pth published at
xbsu/LW-DETR.
Copyright (c) 2024 Baidu. All Rights Reserved. Licensed under the Apache License 2.0.
Upstream's own lineage — Conditional DETR (Microsoft), DETR (Meta), Deformable DETR (SenseTime), and ViTDet (Meta), all Apache-2.0 — is preserved in the source headers of the LibreYOLO port.
Modifications
Metadata wrap only. Learned parameters are unchanged, and no state-dict keys are
renamed. See weights/convert_lwdetr_weights.py in the
LibreYOLO source repository.
The upstream release was saved with --use_ema, so these are the EMA weights
behind the published mAP. The 91-column classification head (one column per COCO
category id) is kept as-is; LibreYOLO maps it to the contiguous 80-class
interface at postprocess time.
Verified bit-exact against the official implementation:
max_abs_diff == 0.0 on both pred_logits and pred_boxes.
License
Apache License 2.0. See the LICENSE and NOTICE
files in this repository.