Object Detection
libreyolo
lw-detr
detr
LibreLWDETRx / README.md
Xuban's picture
Initial upload: LW-DETR COCO weights converted for LibreYOLO
ba9c6f9 verified
|
Raw
History Blame Contribute Delete
2.28 kB
---
license: apache-2.0
library_name: libreyolo
pipeline_tag: object-detection
tags:
- object-detection
- lw-detr
- detr
datasets:
- detection-datasets/coco
---
# LibreLWDETRx
LW-DETR-xlarge (118.0M params, 174.2 GFLOPs, 58.3 AP on COCO val2017), repackaged for [LibreYOLO](https://github.com/LibreYOLO/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.
```python
from libreyolo import LibreYOLO
model = LibreYOLO("LibreLWDETRx.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](https://github.com/Atten4Vis/LW-DETR)
(paper: [arXiv 2406.03459](https://arxiv.org/abs/2406.03459)), from the COCO
checkpoint `LWDETR_xlarge_60e_coco.pth` published at
[xbsu/LW-DETR](https://huggingface.co/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](https://github.com/LibreYOLO/libreyolo).
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`](./LICENSE) and [`NOTICE`](./NOTICE)
files in this repository.