Instructions to use litert-community/swin_base_patch4_window7_224.ms_in1k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/swin_base_patch4_window7_224.ms_in1k with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Add LiteRT TIMM swin_base_patch4_window7_224.ms_in1k
Browse files
README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: litert
|
| 3 |
+
base_model: timm/swin_base_patch4_window7_224.ms_in1k
|
| 4 |
+
pipeline_tag: image-classification
|
| 5 |
+
tags:
|
| 6 |
+
- tflite
|
| 7 |
+
- vision
|
| 8 |
+
- image-classification
|
| 9 |
+
- google
|
| 10 |
+
- computer-vision
|
| 11 |
+
datasets:
|
| 12 |
+
- imagenet-1k
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Swin Base Patch4 Window7 224
|
| 16 |
+
|
| 17 |
+
This repository contains LiteRT/TFLite exports of the TIMM image-classification model `swin_base_patch4_window7_224.ms_in1k`.
|
| 18 |
+
|
| 19 |
+
## Model Description
|
| 20 |
+
|
| 21 |
+
The model files were converted from pretrained TIMM weights published at `timm/swin_base_patch4_window7_224.ms_in1k`.
|
| 22 |
+
|
| 23 |
+
## Available Model Files
|
| 24 |
+
|
| 25 |
+
| File | Description | Quantization |
|
| 26 |
+
|---|---|---|
|
| 27 |
+
| `swin_base_patch4_window7_224_fp32.tflite` | Floating-point LiteRT/TFLite model. | Floating-point weights and activations. |
|
| 28 |
+
| `swin_base_patch4_window7_224_dynamic_wi8_afp32.tflite` | Dynamic weight-quantized LiteRT/TFLite model. | INT8 weights with floating-point activations. |
|
| 29 |
+
| `swin_base_patch4_window7_224_int8_channelwise.tflite` | Static INT8 LiteRT/TFLite model. | INT8 weights and INT8 activations, with channelwise weight quantization. |
|
| 30 |
+
|
| 31 |
+
## Quantization Schema
|
| 32 |
+
|
| 33 |
+
`swin_base_patch4_window7_224_int8_channelwise.tflite` was quantized with AI Edge Quantizer's static W8A8 recipe (`STATIC_WI8_AI8`).
|
| 34 |
+
|
| 35 |
+
The schema is:
|
| 36 |
+
|
| 37 |
+
| Tensor group | Quantization |
|
| 38 |
+
|---|---|
|
| 39 |
+
| Weights | INT8, symmetric, channelwise quantization. |
|
| 40 |
+
| Activations | INT8, asymmetric, tensorwise quantization. |
|
| 41 |
+
| Model input | INT8, tensorwise quantized NCHW image tensor with shape `[1, 3, 224, 224]`. |
|
| 42 |
+
| Model output | INT8, tensorwise quantized logits tensor with shape `[1, 1000]`. |
|
| 43 |
+
|
| 44 |
+
Calibration used real ImageNet validation images with the TIMM preprocessing flow for `swin_base_patch4_window7_224.ms_in1k`. The resolved TIMM preprocessing config was `{"crop_mode": "center", "crop_pct": 0.9, "input_size": [3, 224, 224], "interpolation": "bicubic", "mean": [0.485, 0.456, 0.406], "std": [0.229, 0.224, 0.225]}`. When using APIs that expose raw tensor buffers, prepare the input and output using the quantization parameters stored in the model.
|
| 45 |
+
|
| 46 |
+
## Runtime Compatibility
|
| 47 |
+
|
| 48 |
+
These artifacts are intended for LiteRT CPU and GPU execution.
|
| 49 |
+
|
| 50 |
+
Qualcomm NPU enablement for the static INT8 channelwise artifact is still under validation. LiteRT AOT compilation for SM8750 completed and left 141 top-level op(s) outside Qualcomm NPU dispatch, so this repository does not mark that artifact as Qualcomm-NPU-ready yet.
|
| 51 |
+
|
| 52 |
+
MediaTek NPU enablement for the static INT8 channelwise artifact is still under validation. LiteRT AOT compilation for mt6993 did not complete in this release run, so this repository does not mark that artifact as MediaTek-NPU-ready yet.
|
| 53 |
+
|
| 54 |
+
## Intended Uses & Limitations
|
| 55 |
+
|
| 56 |
+
The model files were converted from pretrained weights from TIMM. The models may have their own licenses or terms and conditions derived from TIMM and the dataset used for training. It is your responsibility to determine whether you have permission to use the models for your use case.
|
| 57 |
+
|
| 58 |
+
## Model Details
|
| 59 |
+
|
| 60 |
+
- **Model Type:** Image classification / feature backbone
|
| 61 |
+
- **Model Stats:**
|
| 62 |
+
- Params (M): 87.8
|
| 63 |
+
- GMACs: 15.5
|
| 64 |
+
- Activations (M): 36.6
|
| 65 |
+
- Image size: 224 x 224
|
| 66 |
+
- **Papers:**
|
| 67 |
+
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows: https://arxiv.org/abs/2103.14030
|
| 68 |
+
- **Original:** https://github.com/microsoft/Swin-Transformer
|
| 69 |
+
- **Dataset:** ImageNet-1k
|
| 70 |
+
|
| 71 |
+
## Citation
|
| 72 |
+
|
| 73 |
+
```bibtex
|
| 74 |
+
@inproceedings{liu2021Swin,
|
| 75 |
+
title={Swin Transformer: Hierarchical Vision Transformer using Shifted Windows},
|
| 76 |
+
author={Liu, Ze and Lin, Yutong and Cao, Yue and Hu, Han and Wei, Yixuan and Zhang, Zheng and Lin, Stephen and Guo, Baining},
|
| 77 |
+
booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
|
| 78 |
+
year={2021}
|
| 79 |
+
}
|
| 80 |
+
```
|
| 81 |
+
```bibtex
|
| 82 |
+
@misc{rw2019timm,
|
| 83 |
+
author = {Ross Wightman},
|
| 84 |
+
title = {PyTorch Image Models},
|
| 85 |
+
year = {2019},
|
| 86 |
+
publisher = {GitHub},
|
| 87 |
+
journal = {GitHub repository},
|
| 88 |
+
doi = {10.5281/zenodo.4414861},
|
| 89 |
+
howpublished = {\url{https://github.com/huggingface/pytorch-image-models}}
|
| 90 |
+
}
|
| 91 |
+
```
|
swin_base_patch4_window7_224_dynamic_wi8_afp32.tflite
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:55bfdab3d0f8dbfdf417a2ff23c4c9664f8ced34d91d408e437c95d173f94627
|
| 3 |
+
size 94472704
|
swin_base_patch4_window7_224_fp32.tflite
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0630ab6e8134df515ed6344cb9ce1ca9f63ac882b81ed1b4e9b37502566ec26d
|
| 3 |
+
size 355730048
|
swin_base_patch4_window7_224_int8_channelwise.tflite
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d46b9df2073e0064b13de4c3a7b2ffdf7f9f02e99411b5c15884208db818c16c
|
| 3 |
+
size 92268592
|