First model version
Browse files- README.md +56 -0
- config.json +32 -0
- pytorch_model.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- image-classification
|
| 4 |
+
library_name: wildlife-datasets
|
| 5 |
+
license: cc-by-nc-4.0
|
| 6 |
+
---
|
| 7 |
+
# Model card
|
| 8 |
+
|
| 9 |
+
A CLIP based image feature model. Supervisely pre-trained on animal re-identification datasets.
|
| 10 |
+
Original model: timm/vit_large_patch14_clip_336.openai_ft_in12k_in1k
|
| 11 |
+
|
| 12 |
+
## Model Details
|
| 13 |
+
- **Model Type:** Animal re-identification / feature backbone
|
| 14 |
+
- **Model Stats:**
|
| 15 |
+
- Params (M): 304.5
|
| 16 |
+
- GMACs: 174.7
|
| 17 |
+
- Activations (M): 128.2
|
| 18 |
+
- Image size: 336 x 336
|
| 19 |
+
|
| 20 |
+
## Model Usage
|
| 21 |
+
### Image Embeddings
|
| 22 |
+
```python
|
| 23 |
+
|
| 24 |
+
import timm
|
| 25 |
+
import torch
|
| 26 |
+
import torchvision.transforms as T
|
| 27 |
+
|
| 28 |
+
from PIL import Image
|
| 29 |
+
from urllib.request import urlopen
|
| 30 |
+
|
| 31 |
+
model = timm.create_model("hf-hub:BVRA/MegaDescriptor-CLIP-336", pretrained=True)
|
| 32 |
+
model = model.eval()
|
| 33 |
+
|
| 34 |
+
transforms = T.Compose([T.Resize(336),
|
| 35 |
+
T.ToTensor(),
|
| 36 |
+
T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])])
|
| 37 |
+
|
| 38 |
+
img = Image.open(urlopen(
|
| 39 |
+
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
|
| 40 |
+
))
|
| 41 |
+
|
| 42 |
+
output = model(transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
|
| 43 |
+
# output is a (1, num_features) shaped tensor
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Citation
|
| 47 |
+
|
| 48 |
+
```bibtex
|
| 49 |
+
@inproceedings{vcermak2024wildlifedatasets,
|
| 50 |
+
title={WildlifeDatasets: An open-source toolkit for animal re-identification},
|
| 51 |
+
author={{\v{C}}erm{\'a}k, Vojt{\v{e}}ch and Picek, Lukas and Adam, Luk{\'a}{\v{s}} and Papafitsoros, Kostas},
|
| 52 |
+
booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision},
|
| 53 |
+
pages={5953--5963},
|
| 54 |
+
year={2024}
|
| 55 |
+
}
|
| 56 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architecture": "vit_large_patch14_clip_336",
|
| 3 |
+
"num_classes": 0,
|
| 4 |
+
"num_features": 1024,
|
| 5 |
+
"global_pool": "token",
|
| 6 |
+
"pretrained_cfg": {
|
| 7 |
+
"custom_load": false,
|
| 8 |
+
"input_size": [
|
| 9 |
+
3,
|
| 10 |
+
336,
|
| 11 |
+
336
|
| 12 |
+
],
|
| 13 |
+
"fixed_input_size": true,
|
| 14 |
+
"interpolation": "bicubic",
|
| 15 |
+
"crop_pct": 1.0,
|
| 16 |
+
"crop_mode": "squash",
|
| 17 |
+
"mean": [
|
| 18 |
+
0.485,
|
| 19 |
+
0.456,
|
| 20 |
+
0.406
|
| 21 |
+
],
|
| 22 |
+
"std": [
|
| 23 |
+
0.229,
|
| 24 |
+
0.224,
|
| 25 |
+
0.225
|
| 26 |
+
],
|
| 27 |
+
"num_classes": 0,
|
| 28 |
+
"pool_size": null,
|
| 29 |
+
"first_conv": "patch_embed.proj",
|
| 30 |
+
"classifier": "head"
|
| 31 |
+
}
|
| 32 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7fb1ee3bb1814fbd271786e9a13920fa657eda05478bb0356623bb4da0c75278
|
| 3 |
+
size 2668099674
|