cermakvo commited on
Commit
75f2ab4
·
1 Parent(s): f4d175a

initial models

Browse files
Files changed (3) hide show
  1. README.md +42 -0
  2. config.json +36 -0
  3. pytorch_model.bin +3 -0
README.md ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - image-classification
4
+ license: cc-by-nc-4.0
5
+ ---
6
+ # Model card
7
+
8
+ A Swin-v2 based species classification model.
9
+ Original model: timm/swinv2_tiny_window16_256.ms_in1k
10
+
11
+ ## Model Details
12
+ - **Model Type:** Animal classification
13
+ - **Model Stats:**
14
+ - Image size: 256 x 256
15
+
16
+ ## Model Usage
17
+ ### Image Embeddings
18
+ ```python
19
+
20
+ import timm
21
+ import torch
22
+ import torchvision.transforms as T
23
+
24
+ from PIL import Image
25
+ from urllib.request import urlopen
26
+
27
+ model = timm.create_model("hf-hub:cermakvo/wildintel-species-classifier-swin-t", pretrained=True)
28
+ model = model.eval()
29
+
30
+ transforms = T.Compose([T.Resize(256),
31
+ T.ToTensor(),
32
+ T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])])
33
+
34
+ img = Image.open(urlopen(
35
+ 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
36
+ ))
37
+
38
+ output = model(transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
39
+ # output is a (1, num_features) shaped tensor
40
+ ```
41
+
42
+
config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architecture": "swinv2_tiny_window16_256",
3
+ "num_classes": 14,
4
+ "num_features": 768,
5
+ "global_pool": "avg",
6
+ "pretrained_cfg": {
7
+ "custom_load": false,
8
+ "input_size": [
9
+ 3,
10
+ 256,
11
+ 256
12
+ ],
13
+ "fixed_input_size": true,
14
+ "interpolation": "bicubic",
15
+ "crop_pct": 0.9,
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": 1000,
28
+ "pool_size": [
29
+ 8,
30
+ 8
31
+ ],
32
+ "first_conv": "patch_embed.proj",
33
+ "classifier": "head.fc",
34
+ "license": "mit"
35
+ }
36
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be001670954070cbc1f8b5b1b00db295ced3fd5789bb1193bd6111a568ccabb4
3
+ size 110424574