chriskoo's picture
Update README.md
cb4ff0a verified
|
Raw History Blame Contribute Delete
3.13 kB
---
license: mit
tags:
- positional encoding
- attention
- image classification
- object detection
- semantic segmentation
- 3D understanding
- video classification
- action recognition
- multimodal
datasets:
- ILSVRC/imagenet-1k
---
# Parabolic Positional Encoding: A Vision-Centric, Principled, Extrapolatable, and General Approach
<p align="left">
<a href="https://arxiv.org/abs/2602.01418"><img src="https://img.shields.io/badge/Paper-arXiv-lightblue"></a>
<a href="https://chrisohrstrom.github.io/parabolic-position-encoding/"><img src="https://img.shields.io/badge/Project-Page-blue"></a>
<a href="https://github.com/DTU-PAS/parabolic-position-encoding/"><img src="https://img.shields.io/badge/github-repo-blue?logo=github"></a>
</p>
These are the official weights for the NeurIPS 2026 Spotlight: [**Parabolic Positional Encoding: A Vision-Centric, Principled, Extrapolatable, and General Approach**](https://arxiv.org/abs/2602.01418).
**Citation**
``` bibtex
@inproceedings{ohrstrom2026pape,
author = {Øhrstrøm, Christoffer Koo and I. Cabral Muchacho, Rafael and Dong, Yifei and Moumtzidellis, Filippos and Güldenring, Ronja and T. Pokorny, Florian and Nalpantidis, Lazaros},
title = {Parabolic Positional Encoding: A Vision-Centric, Principled, Extrapolatable, and General Approach},
booktitle = {Advances in {{Neural Information Processing Systems}}},
year = {2026}
}
```
## Usage
Here is an example of how to load the ImageNet-1K checkpoint. See further below for how to load the other datasets.
Download the weights for ImageNet-1K:
```sh
hf download dtu-pcas/parabolic-positional-encoding --include imagenet1k* --local-dir weights
```
Next load the weights like this:
```py
import json
from pathlib import Path
import torch
from pape.configs import Config
from pape.nn.image_classifier import ImageClassifier
dataset = "imagenet1k"
checkpoint_dir = Path("weights") / dataset
config_path = checkpoint_dir / "config.json"
config = Config.from_dict(json.loads(config_path.read_text()))
model = ImageClassifier(config)
state_dict = torch.load(checkpoint_dir / "model.pt")
model.load_state_dict(state_dict)
```
The other models can be loaded as above, but make sure to substitute the dataset download path and model class `ImageClassifier` to match the dataset:
| Dataset | Path | Network |
| ----------- | ---------------------------------------- | ------------------------------------------ |
| COCO | coco | `pape.nn.image_detector.ImageDetector` |
| DvsGesture | dvsgesture | `pape.nn.event_classifier.EventClassifier` |
| GEN1 | gen1 | `pape.nn.event_detector.EventDetector` |
| ImageNet-1K | imagenet1k | `pape.nn.image_classifier.ImageClassifier` |
| UCF101 | ucf101_fold1, ucf101_fold2, ucf101_fold3 | `pape.nn.video_classifier.VideoClassifier` |
NB. UCF101 is evaluated using cross-validation. We provide weights for each of the three folds.