Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
[ECCV 2024] Official PyTorch implementation of RoPE-ViT "Rotary Position Embedding for Vision Transformer"
| Date | Stars |
|---|---|
| 2026-07-24 | 465 |
| 2026-07-25 | 465 |
| 2026-07-28 | 465 |
| 2026-07-30 | 465 |
| 2026-08-06 | 465 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
<div align="center">
# Rotary Position Embedding for Vision Transformer
**[Byeongho Heo](https://sites.google.com/view/byeongho-heo/home), [Song Park](https://8uos.github.io/), [Dongyoon Han](https://sites.google.com/site/dyhan0920/), [Sangdoo Yun](https://sangdooyun.github.io/)** <br>
[NAVER AI LAB](https://naver-career.gitbook.io/en/teams/clova-cic/ai-lab)
[](https://arxiv.org/abs/2403.13298)
[](https://www.ecva.net/papers/eccv_2024/papers_ECCV/html/1584_ECCV_2024_paper.php)
[](https://huggingface.co/collections/naver-ai/rope-vit-670e367fa2d547b705335153)
</div>
Official PyTorch implementation of RoPE-ViT "Rotary Position Embedding for Vision Transformer" | [arxiv](https://arxiv.org/abs/2403.13298), [ECCV](https://www.ecva.net/papers/eccv_2024/papers_ECCV/html/1584_ECCV_2024_paper.php)
### Abstract
Rotary Position Embedding (RoPE) performs remarkably on language models, especially for length extrapolation of Transformers. However, the impacts of RoPE on computer vision domains have been underexplored, even though RoPE appears capable of enhancing Vision Transformer (ViT) performance in a way similar to the language domain. This study provides a comprehensive analysis of RoPE when applied to ViTs, utilizing practical implementations of RoPE for 2D vision data. The analysis reveals that RoPE demonstrates impressive extrapolation performance, i.e., maintaining precision while increasing image resolution at inference. It eventually leads to performance improvement for ImageNet-1k, COCO detection, and ADE-20k segmentation. We believe this study provides thorough guidelines to apply RoPE into ViT, promising improved backbone performance with minimal extra computational overhead.
## Updates
- **Oct 29, 2025**: Training logs released in `logs/`
- **Oct 16, 2024**: Pre-trained weights are uploaded to [huggingface hub](https://huggingface.co/collections/naver-ai/rope-vit-670e367fa2d547b705335153)
- **Apr 16, 2024**: Pre-trained weights released
- **Apr 15, 2024**: Code released
- **Mar 21, 2024**: Arxiv paper was released
## Getting Started
You can find RoPE implementations at each folder.
- `deit/` : RoPE on DeiT-III training code *"DeiT III: Revenge of the ViT"* [original repo](https://github.com/facebookresearch/deit)
- `swin/` : RoPE on Swin Transformer training code *"Swin Transformer: Hierarchical Vision Transformer using Shifted Windows"* [original repo](https://github.com/microsoft/Swin-Transformer)
- `models/` : Only RoPE model files that used for DeiT and Swin.
- `self-attn/` : Minimum implementation of RoPE in self-attention layer
- `logs/` : Training logs for `deit` and `swin`
## Performances
### DeiT-III

### Swin Transformer

## Pre-trained weights
- You can access the pre-trained weights on our [huggingface hub](https://huggingface.co/collections/naver-ai/rope-vit-670e367fa2d547b705335153)
- `pretrained=True` for models in `models/` will automatically load pre-trained weights from huggingface hub
```python
from models import vit_rope
model = vit_rope.rope_mixed_deit_small_patch16_LS(pretrained=True)
from models import swin_transformer_rope
model = swin_transformer_rope.swin_rope_mixed_tiny_patch4_window7_224(pretrained=True)
```
- For inference with `256x256` images
```python
from models import vit_rope
model = vit_rope.rope_mixed_deit_small_patch16_LS(pretrained=True, img_size=256)
from models import swin_transformer_rope
model = swin_transformer_rope.swin_rope_mixed_tiny_patch4_window7_224(pretrained=True, img_size=256)
```
### DeiT-III (400 epochs)
| Model Name | Top-1 (224) | Top-1 (384) | Weights |
|----------Excerpt of 12,322 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:d6ec76b39623a0b1, topic:transformer