We follow LV-ViT to train our models with Token Labeling.
The followed models and logs can be downloaded on Google Drive: total_models, total_logs.
We also release the models on Baidu Cloud: total_models (p05h), total_logs (wsvi).
We follow LV-ViT to train our models with Token Labeling. Please see token_labeling for more details.
Model | Top-1 | #Param. | FLOPs | Model | Log | Shell |
---|---|---|---|---|---|---|
UniFormer-S | 83.4 (+0.5) | 22M | 3.6G | run.sh | ||
UniFormer-S† | 83.9 (+0.5) | 24M | 4.2G | run.sh | ||
UniFormer-B | 85.1 (+1.3) | 50M | 8.3G | run.sh | ||
UniFormer-L+Layer Scale | 85.6 | 100M | 12.6G | run.sh |
Due to the models UniFormer-S/S†/B use head_dim=32
, which cause much memory cost for downstream tasks. We re-train these models with head_dim=64
. All models are trained with 224x224 resolution.
Model | Top-1 | #Param. | FLOPs | Model | Log | Shell |
---|---|---|---|---|---|---|
UniFormer-S | 83.4 (+0.5) | 22M | 3.6G | run.sh | ||
UniFormer-S† | 83.6 (+0.2) | 24M | 4.2G | run.sh | ||
UniFormer-B | 84.8 (+1.0) | 50M | 8.3G | run.sh |
The followed models and logs can be downloaded on Google Drive: total_models, total_logs.
We also release the models on Baidu Cloud: total_models (p05h), total_logs (wsvi).
We fine-tune the above models with Token Labeling on resolution of 384x384. Please see token_labeling for more details.
Model | Top-1 | #Param. | FLOPs | Model | Log | Shell |
---|---|---|---|---|---|---|
UniFormer-S | 84.6 | 22M | 11.9G | run.sh | ||
UniFormer-S† | 84.9 | 24M | 13.7G | run.sh | ||
UniFormer-B | 86.0 | 50M | 27.2G | run.sh | ||
UniFormer-L+Layer Scale | 86.3 | 100M | 39.2G | run.sh |
Our repository is built base on the TokenLabeling repository.
-
Clone this repo:
git clone https://github.com/Sense-X/UniFormer.git cd UniFormer
-
Install PyTorch 1.7.0+ and torchvision 0.8.1+
conda install -c pytorch pytorch torchvision
-
Install other packages
pip install timm
For Token Labeling, we need to download the dense label map.
We provide NFNet-F6 generated dense label map in Google Drive and BaiDu Yun (password: y6j2). As NFNet-F6 are based on pure ImageNet data, no extra training data is involved.
Simply run the training scripts in exp as followed:
bash ./exp/uniformer_small_tl_224/run.sh
You should set the dense label data path via --token-label-data
.
Simply run the evaluating scripts in exp as followed:
bash ./exp/uniformer_small_tl_224/test.sh
You should set the checkpoint file path via --checkpoint
.
Simply run the training scripts in exp as followed:
bash ./exp/uniformer_small_tl_384/run.sh
You should set the pretrained model file path via --finetune
.
This repository is built using the timm library and the TokenLabeling repository.