Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,103 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- image-classification
|
| 4 |
+
- birder
|
| 5 |
+
- pytorch
|
| 6 |
+
library_name: birder
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Model Card for efficientvim_m1_il-common
|
| 11 |
+
|
| 12 |
+
A EfficientViM image classification model. This model was trained on the `il-common` dataset, which contains common bird species found in Israel.
|
| 13 |
+
|
| 14 |
+
The species list is derived from data available at <https://www.israbirding.com/checklist/>.
|
| 15 |
+
|
| 16 |
+
## Model Details
|
| 17 |
+
|
| 18 |
+
- **Model Type:** Image classification and detection backbone
|
| 19 |
+
- **Model Stats:**
|
| 20 |
+
- Params (M): 6.1
|
| 21 |
+
- Input image size: 256 x 256
|
| 22 |
+
- **Dataset:** il-common (371 classes)
|
| 23 |
+
|
| 24 |
+
- **Papers:**
|
| 25 |
+
- EfficientViM: Efficient Vision Mamba with Hidden State Mixer based State Space Duality: <https://arxiv.org/abs/2411.15241>
|
| 26 |
+
|
| 27 |
+
## Model Usage
|
| 28 |
+
|
| 29 |
+
### Image Classification
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
import birder
|
| 33 |
+
from birder.inference.classification import infer_image
|
| 34 |
+
|
| 35 |
+
(net, model_info) = birder.load_pretrained_model("efficientvim_m1_il-common", inference=True)
|
| 36 |
+
|
| 37 |
+
# Get the image size the model was trained on
|
| 38 |
+
size = birder.get_size_from_signature(model_info.signature)
|
| 39 |
+
|
| 40 |
+
# Create an inference transform
|
| 41 |
+
transform = birder.classification_transform(size, model_info.rgb_stats)
|
| 42 |
+
|
| 43 |
+
image = "path/to/image.jpeg" # or a PIL image, must be loaded in RGB format
|
| 44 |
+
(out, _) = infer_image(net, image, transform)
|
| 45 |
+
# out is a NumPy array with shape of (1, 371), representing class probabilities.
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
### Image Embeddings
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
import birder
|
| 52 |
+
from birder.inference.classification import infer_image
|
| 53 |
+
|
| 54 |
+
(net, model_info) = birder.load_pretrained_model("efficientvim_m1_il-common", inference=True)
|
| 55 |
+
|
| 56 |
+
# Get the image size the model was trained on
|
| 57 |
+
size = birder.get_size_from_signature(model_info.signature)
|
| 58 |
+
|
| 59 |
+
# Create an inference transform
|
| 60 |
+
transform = birder.classification_transform(size, model_info.rgb_stats)
|
| 61 |
+
|
| 62 |
+
image = "path/to/image.jpeg" # or a PIL image
|
| 63 |
+
(out, embedding) = infer_image(net, image, transform, return_embedding=True)
|
| 64 |
+
# embedding is a NumPy array with shape of (1, 320)
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
### Detection Feature Map
|
| 68 |
+
|
| 69 |
+
```python
|
| 70 |
+
from PIL import Image
|
| 71 |
+
import birder
|
| 72 |
+
|
| 73 |
+
(net, model_info) = birder.load_pretrained_model("efficientvim_m1_il-common", inference=True)
|
| 74 |
+
|
| 75 |
+
# Get the image size the model was trained on
|
| 76 |
+
size = birder.get_size_from_signature(model_info.signature)
|
| 77 |
+
|
| 78 |
+
# Create an inference transform
|
| 79 |
+
transform = birder.classification_transform(size, model_info.rgb_stats)
|
| 80 |
+
|
| 81 |
+
image = Image.open("path/to/image.jpeg")
|
| 82 |
+
features = net.detection_features(transform(image).unsqueeze(0))
|
| 83 |
+
# features is a dict (stage name -> torch.Tensor)
|
| 84 |
+
print([(k, v.size()) for k, v in features.items()])
|
| 85 |
+
# Output example:
|
| 86 |
+
# [('stage1', torch.Size([1, 128, 16, 16])),
|
| 87 |
+
# ('stage2', torch.Size([1, 192, 8, 8])),
|
| 88 |
+
# ('stage3', torch.Size([1, 320, 4, 4]))]
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
## Citation
|
| 92 |
+
|
| 93 |
+
```bibtex
|
| 94 |
+
@misc{lee2025efficientvimefficientvisionmamba,
|
| 95 |
+
title={EfficientViM: Efficient Vision Mamba with Hidden State Mixer based State Space Duality},
|
| 96 |
+
author={Sanghyeok Lee and Joonmyung Choi and Hyunwoo J. Kim},
|
| 97 |
+
year={2025},
|
| 98 |
+
eprint={2411.15241},
|
| 99 |
+
archivePrefix={arXiv},
|
| 100 |
+
primaryClass={cs.CV},
|
| 101 |
+
url={https://arxiv.org/abs/2411.15241},
|
| 102 |
+
}
|
| 103 |
+
```
|