SQ-DETR research code for DETR-style object detection experiments with query-dropping configurations.
This repository is a cleaned public snapshot of the implementation surface: model code, training entrypoint, and representative experiment configs. Datasets, checkpoints, generated outputs, notebooks, and machine-local helper notes are intentionally excluded.
src/— model, solver, data, optimization, and utility codeconfigs/— RT-DETR baselines and SQ-DETR experiment configstools/train.py— train/evaluate/FLOPs entrypointtools/experiments.sh— example commands
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txtInstall the PyTorch/CUDA build that matches your machine if the pinned wheel in requirements.txt is not appropriate for your environment.
Configs use git-ignored local dataset paths by default:
datasets/
coco2017/
train2017/
val2017/
annotations/instances_train2017.json
annotations/instances_val2017.json
CrowdHuman/
train/
val/
annotations/train.json
annotations/val.json
Adjust img_folder, ann_file, and output_dir in the selected config if your layout differs.
# Train SQ-DETR R18 on a COCO-style config
torchrun --nproc_per_node=2 tools/train.py -c configs/sqdetr/r18/r18_hc_50_50_50.yml
# Evaluate from a local checkpoint
torchrun --nproc_per_node=2 tools/train.py -c configs/sqdetr/r50/r50_hc_25.yml -r output/sq_detr_r50/hc_25/best.pth --test-only
# Print FLOPs breakdown
torchrun --nproc_per_node=2 tools/train.py -c configs/sqdetr/r50/r50_hc_25.yml --flopsDo not commit datasets, checkpoints, generated runs, notebooks, local environment files, credentials, or personal command notes. The repository .gitignore covers the usual paths and artifact types.
Apache License 2.0.