Commit
·
972fc76
1
Parent(s):
4f15651
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,72 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- imagenet-1k
|
| 5 |
+
metrics:
|
| 6 |
+
- accuracy
|
| 7 |
+
pipeline_tag: image-classification
|
| 8 |
+
tags:
|
| 9 |
+
- pytorch
|
| 10 |
+
- torch-dag
|
| 11 |
---
|
| 12 |
+
# Model Card for resnet50d_pruned_56
|
| 13 |
+
|
| 14 |
+
This is a prunned version of the [timm/resnet50d.a3_in1k](https://huggingface.co/timm/resnet50d.a3_in1k) model in a [toch-dag](https://github.com/TCLResearchEurope/torch-dag) format.
|
| 15 |
+
|
| 16 |
+
This model has rougly 56% of the original model FLOPs with minimal metrics drop.
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
| Model | KMAPPs* | M Parameters | Accuracy (224x224) |
|
| 20 |
+
| ----------- | ----------- | ----------- | ------------------ |
|
| 21 |
+
| **timm/resnet50d.a3_in1 (baseline)** | 174 | 25.6 | 80.9% |
|
| 22 |
+
| **resnet50d_pruned_56 (ours)** | 96.6 **(56%)** | 16.3 **(64%)** | 79.75% **(↓ 1.15%)** |
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
\***KMAPPs** thousands of FLOPs per input pixel
|
| 26 |
+
|
| 27 |
+
`KMAPPs(model) = FLOPs(model) / (H * W * 1000)`, where `(H, W)` is the input resolution.
|
| 28 |
+
|
| 29 |
+
The accuracy was calculated on the ImageNet-1k validation dataset. For details about image pre-processing, please refer to the original repository.
|
| 30 |
+
## Model Details
|
| 31 |
+
|
| 32 |
+
### Model Description
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
- **Developed by:** [TCL Research Europe](https://github.com/TCLResearchEurope/)
|
| 36 |
+
- **Model type:** Classification / feature backbone
|
| 37 |
+
- **License:** Apache 2.0
|
| 38 |
+
- **Finetuned from model:** [timm/resnet50d.a3_in1k](https://huggingface.co/timm/resnet50d.a3_in1k)
|
| 39 |
+
|
| 40 |
+
### Model Sources
|
| 41 |
+
- **Repository:** [timm/resnet50d.a3_in1k](https://huggingface.co/timm/resnet50d.a3_in1k)
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
## How to Get Started with the Model
|
| 46 |
+
|
| 47 |
+
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
|
| 48 |
+
|
| 49 |
+
```
|
| 50 |
+
pip install torch-dag
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
then, clone this repository
|
| 54 |
+
|
| 55 |
+
```
|
| 56 |
+
# Make sure you have git-lfs installed (https://git-lfs.com)
|
| 57 |
+
git lfs install
|
| 58 |
+
git clone https://huggingface.co/TCLResearchEurope/resnet50d_pruned_56
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
and now You are ready to load the model:
|
| 62 |
+
|
| 63 |
+
```
|
| 64 |
+
import torch_dag
|
| 65 |
+
import torch
|
| 66 |
+
|
| 67 |
+
model = torch_dag.io.load_dag_from_path('./resnet50d_pruned_56')
|
| 68 |
+
|
| 69 |
+
model.eval()
|
| 70 |
+
out = model(torch.ones(1, 3, 224, 224))
|
| 71 |
+
print(out.shape)
|
| 72 |
+
```
|