cermakvo commited on
Commit
59ab442
·
1 Parent(s): 484f60a

First model version

Browse files
Files changed (3) hide show
  1. README.md +56 -0
  2. config.json +33 -0
  3. 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 DINOv2 based image feature model. Supervisely pre-trained on animal re-identification datasets.
10
+ Original model: timm/vit_large_patch14_dinov2.lvd142m
11
+
12
+ ## Model Details
13
+ - **Model Type:** Animal re-identification / feature backbone
14
+ - **Model Stats:**
15
+ - Params (M): 304.4
16
+ - GMACs: 507.1
17
+ - Activations (M): 1058.8
18
+ - Image size: 518 x 518
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-DINOv2-518", pretrained=True)
32
+ model = model.eval()
33
+
34
+ transforms = T.Compose([T.Resize(518),
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,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architecture": "vit_large_patch14_dinov2",
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
+ 518,
11
+ 518
12
+ ],
13
+ "fixed_input_size": true,
14
+ "interpolation": "bicubic",
15
+ "crop_pct": 1.0,
16
+ "crop_mode": "center",
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
+ "license": "cc-by-nc-4.0"
32
+ }
33
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6951c106d26f3f61d5166782242d33c6aefef0f8452d70cd4da4886c8133d838
3
+ size 2675009592