Home

Awesome

Learned Queries for Efficient Local Attention (CVPR 2022 - Oral)


[ Arxiv ]

QnA-Overview


Updates (April 19th):


Models

Pretrained models can be downloaded from this link.

ModelParamsGFLOPsTop-1Warmup
QnA_ViT_tiny16M2.581.75
QnA_ViT_tiny_7x716M2.682.05
QnA_ViT_small25M4.483.25
QnA_ViT_base56M9.783.920

Evaluation

Download the model parameters and copy

CUDA_VISIBLE_DEVICES=0 python3 main.py --eval_only \
    --workdir <MODEL_DIR> \ 
    --config configs/imagenet_qna.py \
    --config.model_name <MODEL_DIR> \ 
    --config.dataset_version 5.1.0  \
    --config.data_dir <DATA_DIR> \
    --config.batch_size <BATCH_SIZE> \
    --config.half_precision=False

Flags:

- workdir : location to the checkpoints directory
- model_name : the model name, e.g., qna_vit_tiny (see table above for model names - use lowercase names only).
- dataset_version : Tensorflow datasets ImageNet dataset version. Mine was (5.1.0),
                     you can change according to your installed version.
- data_dir : the location of the ImageNet directory (need to have the validation set)
- batch_size : the evaluation batch size

Citation

Please cite our paper if you find this repo helpful:

@InProceedings{Arar_2022_CVPR,
author = {Arar, Moab and Shamir, Ariel and Bermano, Amit H.},
title = {Learned Queries for Efficient Local Attention},
booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2022}
}