Add lw-detr models#332
Closed
srishtiii28 wants to merge 4 commits into
Closed
Conversation
d0703f0 to
e52a1b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #328
Adds four variants of the LW-DETR from the Atten4Vis implementation:
The architecture is a ViT encoder with interleaved window or global attention, a C2f projector from the YOLOv8 and a 3-layer DETR decoder which has deformable cross-attention. Two-stage query selection and Group DETR which contains 13 groups are used during training but only the primary group is used at inference. The pretrained COCO weights are fetched via
download_and_cache(). And all the four checkpoints load with zero missing or unexpected keys.Since torchvisionlib #25 is still open, deformable cross-attention uses a pure PyTorch nnf_grid_sample fallback and no CUDA dependency. The CUDA operation can be swapped in once that issue is resolved.
The input images should be ImageNet-normalized tensors of shape (B, 3, H, W), square and divisible by 64. 640×640 would be recommended . Output would be a list of detections per image with boxes i.e. xyxy pixels), labels, and scores.