Downloads · 30 days
6
12% of all-time downloads
dronefreak/co-dino-5scale-9encoder-lsj-r50-3x-coco
co-dino-5scale-9encoder-lsj-r50-3x-coco is a object detection model from dronefreak. Use it when you need objects located in an image. It is set up for mmdetection. The card lists the license as unknown.
Demo banner: 1x2 montage of tools/inference.py video outputs produced with THIS checkpoint. Media lives under assets/ in this repo. The <video renders on the Hugging Face model page; on GitHub the nested <img poster s…
Downloads · 30 days
6
12% of all-time downloads
All-time downloads
49
Public
Repo size
830 MB
Likes
0
Public
Click a slice to open those files.
.pth828 MB · 100%
From the Hugging Face model README
This is not an official release. All credit for the method, the architecture, and the trained weights belongs entirely to the original authors: Zhuofan Zong, Guanglu Song, and Yu Liu (SenseTime X-Lab). I claim no contribution to the underlying research or training. I host the same checkpoint the authors published to Google Drive, with a model card and a copy of its config file.
The original non-ViT Co-DETR checkpoints are distributed through a single shared Google Drive folder, which is inconvenient for automated and reproducible downloads (no per-file addressing, checksums, or versioning). The authors published their ViT-L checkpoints to the Hub but not the ResNet-50 / Swin ones. I mirror this checkpoint to provide stable artifact hosting, an explicit file checksum (see Provenance), and versioned Hub access.
I mirror only the pretrained weights; I do not redistribute any training or
evaluation data. I will transfer or remove this mirror at the original
authors' request. Please cite the original paper (see Citation)
and use the official repository or the
maintained fork dronefreak/Co-DETR
for code.
This is not a plain-PyTorch /
transformersmodel. Inference needs the Co-DETR project code and the OpenMMLab 1.x stack (MMDetection 2.25.3, MMCV-full 1.5.0, PyTorch 1.11). The maintained fork ships a one-command environment setup for exactly this.
# 1. Get the code + a validated environment
git clone https://github.com/dronefreak/Co-DETR && cd Co-DETR
bash tools/setup_codetr_env.sh # builds the `codetr` conda env
conda activate codetr
# 2. Pull this checkpoint + its config from the Hub
pip install -U "huggingface_hub[cli]"
hf download dronefreak/co-dino-5scale-9encoder-lsj-r50-3x-coco \
co_dino_5scale_9encoder_lsj_r50_3x_coco.pth co_dino_5scale_9encoder_lsj_r50_3x_coco.py \
--local-dir checkpoints/
# 3. Run detection on an image / folder / video / webcam
python tools/inference.py \
--config checkpoints/co_dino_5scale_9encoder_lsj_r50_3x_coco.py \
--checkpoint checkpoints/co_dino_5scale_9encoder_lsj_r50_3x_coco.pth \
--input demo/demo.jpg --out-dir outputs/ --save-json
The bundled config is identical to
projects/configs/co_dino/co_dino_5scale_9encoder_lsj_r50_3x_coco.py in the repo.
Co-DETR ("DETRs with Collaborative Hybrid Assignments Training") is a
training scheme, not a new architecture. It attaches auxiliary heads that use
one-to-many label assignment (an ATSS head and a Faster-R-CNN-style RoI
head) alongside the DETR decoder's one-to-one Hungarian matching, and feeds
the positive proposals those heads produce back into the decoder as extra
queries. This makes the encoder's features more discriminative and speeds up
convergence. The auxiliary heads are used only during training: this
checkpoint's config sets eval_module='detr', so at inference only the
Co-DINO query head runs and the RPN / RoI / ATSS heads add no
inference-time computation to the deployed detector.
This checkpoint is Co-DINO (5 feature scales, 9 encoder layers, LSJ) with a ResNet-50 backbone:
| Detector | CoDETR meta-model; deployed head is CoDINOHead |
| Backbone | ResNet-50, pretrained on ImageNet-1k (torchvision://resnet50) |
| Object queries | 900 |
| Aux heads in state-dict | RPNHead + CoStandardRoIHead, CoATSSHead: present in the weights but not executed at inference (eval_module='detr') |
| Parameters | 52.8 M executed at inference (backbone + neck + query head). The checkpoint additionally stores the training-only RPN / RoI / ATSS heads (69.1 M total), which inference never touches. |
| Classes | 80 (COCO things) |
| Training schedule | COCO train2017, 3x (36 epochs) |
| Test-time input | single scale, no flip / no TTA (the config's test pipeline; see Measured inference footprint for the actual resized size on the sample image) |
co_dino_5scale_9encoder_lsj_r50_3x_coco.py (bundled; identical to the Co-DETR repo copy)Intended use. Research and engineering work that needs a COCO-pretrained object detector in the Co-DETR family: as a baseline, a feature/detection backbone, or a starting point for fine-tuning on a custom COCO-format dataset.
Limitations.
thing
categories and nothing else.transformers / pipeline() support,
and inference: false on the Hub.Integrity and "does it load and run" checks only. This is not an accuracy reproduction:
codetr env
(Python 3.8 / torch 1.11.0+cu113 / mmcv-full 1.5.0 / mmdet 2.25.3): zero
missing, zero unexpected keys.tools/inference.py on the two dashcam clips
shown in the banner above; it produced valid annotated outputs.Method. I built the model with mmdet.apis.init_detector, then ran
inference_detector() on a single image, device='cuda:0', batch size 1,
FP32 (no AMP), cudnn.benchmark=False: one warm-up call, then
torch.cuda.reset_peak_memory_stats() and 10 timed calls with
torch.cuda.synchronize(). max_memory_allocated includes the resident model
weights plus activation buffers; it excludes the CUDA context.
| Item | Value |
|---|---|
| GPU | NVIDIA GeForce RTX 4070 SUPER, 12 GB, driver 580.173.02 |
| Stack | Python 3.8, torch 1.11.0+cu113, mmcv-full 1.5.0, mmdet 2.25.3 |
| Precision / batch | FP32 / 1 |
| Params executed at inference | 52.8 M |
| Params stored in the checkpoint | 69.1 M |
| Test image | demo/demo.jpg -> 1024 x 1024 fed to backbone |
Peak max_memory_allocated | 1657 MiB (1.74 GB) |
Peak max_memory_reserved | 2152 MiB (2.26 GB) |
| Latency / image (warm, n=10) | mean 268 ms (266-271) |
CPU inference (--device cpu) also works and needs no GPU; it is slower.
| Benchmark | Metric | Value | Source | Reproduced here? |
|---|---|---|---|---|
COCO val2017 | box AP | 55.4 | Co-DETR paper (arXiv:2211.12860) / official model zoo | No |
Schedule: 3x (36 epochs), 900 object queries, single-scale test, no TTA. I have not independently re-measured these numbers.
train2017: 118k images, 80 things categories. Lin et al.,
Microsoft COCO: Common Objects in Context, ECCV 2014
(arXiv:1405.0312).I do not redistribute COCO here. Get it from cocodataset.org. This checkpoint was trained using COCO and ImageNet initialization only; no Objects365 pretraining is described for it.
The Co-DETR source code is MIT-licensed (© 2022 SenseTime X-Lab, LICENSE). The upstream repository does not provide a separate, explicit license for this checkpoint's weights. The original authors have published other Co-DETR checkpoints (the ViT-L family) on Hugging Face with MIT metadata, but I do not treat that as definitive evidence that these weights are independently licensed under MIT.
Because the applicable rights are undetermined, I set the Hub metadata for
this repo to license: unknown. Verify the applicable rights yourself
before redistribution or commercial use.
If you are one of the original authors and want this mirror removed or transferred, open an issue on this repo or contact dronefreak and I will action it.
@inproceedings{zong2023detrs,
title={DETRs with Collaborative Hybrid Assignments Training},
author={Zong, Zhuofan and Song, Guanglu and Liu, Yu},
booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
pages={6748--6758},
year={2023}
}
The underlying detector and backbone:
@inproceedings{zhu2021deformable,
title={Deformable DETR: Deformable Transformers for End-to-End Object Detection},
author={Zhu, Xizhou and Su, Weijie and Lu, Lewei and Li, Bin and Wang, Xiaogang and Dai, Jifeng},
booktitle={International Conference on Learning Representations (ICLR)},
year={2021}
}
@inproceedings{he2016deep,
title={Deep Residual Learning for Image Recognition},
author={He, Kaiming and Zhang, Xiangyu and Ren, Shaoqing and Sun, Jian},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
pages={770--778},
year={2016}
}
Built with MMDetection / MMCV (OpenMMLab).
I sincerely thank Zhuofan Zong, Guanglu Song, and Yu Liu for developing Co-DETR and releasing the pretrained weights, and the OpenMMLab team for MMDetection and MMCV. This mirror only makes one of their existing checkpoints easier and more reliable to obtain.
co_dino_5scale_9encoder_lsj_r50_3x_coco.pth, 828,086,923 bytes, SHA-256 7b527af77fd7fa28711d79c5db362dd6c024c675cc56278c80aadcb1be5d3893. I copied it byte-for-byte and unmodified from the authors' Google Drive folder 1nAXOkzqrEgz-YnXxIEs4d5j9li_kmrnv.
Repo files: co_dino_5scale_9encoder_lsj_r50_3x_coco.pth (weights), co_dino_5scale_9encoder_lsj_r50_3x_coco.py (the MMDetection config needed to build the model), config.json (metadata summary; also what the Hub uses to count downloads), plus assets/demo_banner.mp4 / assets/demo_banner_poster.jpg for the card. config.json is descriptive only, inference: false, and is not a transformers config.