Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- image-classification
|
4 |
+
- ecology
|
5 |
+
- animals
|
6 |
+
- re-identification
|
7 |
+
library_name: wildlife-datasets
|
8 |
+
license: cc-by-nc-4.0
|
9 |
+
---
|
10 |
+
# Model card for MegaDescriptor-B-224
|
11 |
+
|
12 |
+
A Swin-L image feature model. Superwisely pre-trained on animal re-identification datasets.
|
13 |
+
|
14 |
+
|
15 |
+
## Model Details
|
16 |
+
- **Model Type:** Animal re-identification / feature backbone
|
17 |
+
- **Model Stats:**
|
18 |
+
- Params (M): ??
|
19 |
+
- Image size: 384 x 384
|
20 |
+
- **Papers:**
|
21 |
+
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows --> https://arxiv.org/abs/2103.14030
|
22 |
+
- **Original:** ??
|
23 |
+
- **Pretrain Dataset:** All available re-identification datasets --> TBD
|
24 |
+
|
25 |
+
## Model Usage
|
26 |
+
### Image Embeddings
|
27 |
+
```python
|
28 |
+
|
29 |
+
import timm
|
30 |
+
import torch
|
31 |
+
import torchvision.transforms as T
|
32 |
+
|
33 |
+
from PIL import Image
|
34 |
+
from urllib.request import urlopen
|
35 |
+
|
36 |
+
model = timm.create_model("hf-hub:BVRA/wildlife-mega", pretrained=True)
|
37 |
+
model = model.eval()
|
38 |
+
|
39 |
+
train_transforms = T.Compose([T.Resize(224),
|
40 |
+
T.ToTensor(),
|
41 |
+
T.Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5])])
|
42 |
+
|
43 |
+
img = Image.open(urlopen(
|
44 |
+
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
|
45 |
+
))
|
46 |
+
|
47 |
+
output = model(train_transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
|
48 |
+
# output is a (1, num_features) shaped tensor
|
49 |
+
```
|
50 |
+
|
51 |
+
## Citation
|
52 |
+
|
53 |
+
```bibtex
|
54 |
+
TBD
|
55 |
+
```
|