|
|
--- |
|
|
license: apache-2.0 |
|
|
datasets: |
|
|
- imagenet-1k |
|
|
metrics: |
|
|
- accuracy |
|
|
pipeline_tag: image-classification |
|
|
tags: |
|
|
- pytorch |
|
|
- torch-dag |
|
|
--- |
|
|
# Model Card for deit3_small_patch16_224_pruned_47 |
|
|
|
|
|
This is a prunned version of the [timm/deit3_small_patch16_224.fb_in22k_ft_in1k](https://huggingface.co/timm/deit3_small_patch16_224.fb_in22k_ft_in1k) model in a [toch-dag](https://github.com/TCLResearchEurope/torch-dag) format. |
|
|
|
|
|
This model has rougly 47% of the original model FLOPs with minimal metrics drop. |
|
|
|
|
|
|
|
|
| Model | KMAPPs* | M Parameters | Accuracy (224x224) | |
|
|
| ----------- | ----------- | ----------- | ------------------ | |
|
|
| **timm/deit3_small_patch16_224.fb_in22k_ft_in1 (baseline)** | 184 | 22 | 82.87% | |
|
|
| **deit3_small_patch16_224_pruned_47 (ours)** | 87.2 **(47%)** | 10.2 **(46%)** | 80.87% **(↓ 2.0%)** | |
|
|
|
|
|
|
|
|
\***KMAPPs** thousands of FLOPs per input pixel |
|
|
|
|
|
`KMAPPs(model) = FLOPs(model) / (H * W * 1000)`, where `(H, W)` is the input resolution. |
|
|
|
|
|
The accuracy was calculated on the ImageNet-1k validation dataset. For details about image pre-processing, please refer to the original repository. |
|
|
## Model Details |
|
|
|
|
|
### Model Description |
|
|
|
|
|
|
|
|
- **Developed by:** [TCL Research Europe](https://github.com/TCLResearchEurope/) |
|
|
- **Model type:** Classification / feature backbone |
|
|
- **License:** Apache 2.0 |
|
|
- **Finetuned from model:** [timm/deit3_small_patch16_224.fb_in22k_ft_in1k](https://huggingface.co/timm/deit3_small_patch16_224.fb_in22k_ft_in1k) |
|
|
|
|
|
### Model Sources |
|
|
- **Repository:** [timm/deit3_small_patch16_224.fb_in22k_ft_in1k](https://huggingface.co/timm/deit3_small_patch16_224.fb_in22k_ft_in1k) |
|
|
|
|
|
|
|
|
|
|
|
## How to Get Started with the Model |
|
|
|
|
|
To load the model, You have to install [torch-dag](https://github.com/TCLResearchEurope/torch-dag#3-installation) library, which can be done using `pip` by |
|
|
|
|
|
``` |
|
|
pip install torch-dag |
|
|
``` |
|
|
|
|
|
then, clone this repository |
|
|
|
|
|
``` |
|
|
# Make sure you have git-lfs installed (https://git-lfs.com) |
|
|
git lfs install |
|
|
git clone https://huggingface.co/TCLResearchEurope/deit3_small_patch16_224_pruned_47 |
|
|
``` |
|
|
|
|
|
and now You are ready to load the model: |
|
|
|
|
|
``` |
|
|
import torch_dag |
|
|
import torch |
|
|
|
|
|
model = torch_dag.io.load_dag_from_path('./deit3_small_patch16_224_pruned_47') |
|
|
|
|
|
model.eval() |
|
|
out = model(torch.ones(1, 3, 224, 224)) |
|
|
print(out.shape) |
|
|
``` |