mnjm commited on
Commit
31cea46
·
verified ·
1 Parent(s): 0ea7e46

Upload folder using huggingface_hub

Browse files
Files changed (5) hide show
  1. README.md +38 -0
  2. config.json +24 -0
  3. model.safetensors +3 -0
  4. preprocessor_config.json +22 -0
  5. raw_checkpoint.zip +3 -0
README.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ pipeline_tag: image-feature-extraction
4
+ tags:
5
+ - dino
6
+ - self-supervised
7
+ - vision-transformer
8
+ - food101
9
+ datasets:
10
+ - ethz/food101
11
+ ---
12
+
13
+ # DINOv1-ViT-S-16-food101
14
+
15
+ DINOv1 ViT-S/16 model trained from scratch on the Food-101 dataset using a custom training [repo](https://github.com/mnjm/dino).
16
+
17
+ ## Evaluation
18
+
19
+ Weighted k-NN evaluation on Food-101 validation features:
20
+
21
+ | k | Top-1 accuracy | Top-5 accuracy |
22
+ | --- | --- | --- |
23
+ | 5 | 64.09% | 79.93% |
24
+ | 10 | 66.38% | 83.47% |
25
+ | 20 | 67.59% | 86.17% |
26
+ | 100 | 67.81% | 88.72% |
27
+
28
+ ## Run
29
+
30
+ ```python
31
+ from transformers import AutoImageProcessor, ViTModel
32
+
33
+ processor = AutoImageProcessor.from_pretrained("mnjm/DINOv1-ViT-S-16-food101")
34
+ model = ViTModel.from_pretrained("mnjm/DINOv1-ViT-S-16-food101")
35
+ inputs = processor(images=image, return_tensors="pt")
36
+ outputs = model(**inputs)
37
+ image_features = outputs.last_hidden_state[:, 0]
38
+ ```
config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ViTModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.0,
6
+ "dtype": "float32",
7
+ "encoder_stride": 16,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.0,
10
+ "hidden_size": 384,
11
+ "image_size": 224,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 1536,
14
+ "layer_norm_eps": 1e-05,
15
+ "model_type": "vit",
16
+ "num_attention_heads": 6,
17
+ "num_channels": 3,
18
+ "num_hidden_layers": 12,
19
+ "patch_size": 16,
20
+ "pooler_act": "tanh",
21
+ "pooler_output_size": 384,
22
+ "qkv_bias": true,
23
+ "transformers_version": "5.14.1"
24
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9dcba56ede86cd3d9861ad8476163bfc66e9a0ea02dd9200cc1de464f9eda2b2
3
+ size 86684608
preprocessor_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "do_rescale": true,
4
+ "do_resize": true,
5
+ "image_mean": [
6
+ 0.485,
7
+ 0.456,
8
+ 0.406
9
+ ],
10
+ "image_processor_type": "ViTImageProcessor",
11
+ "image_std": [
12
+ 0.229,
13
+ 0.224,
14
+ 0.225
15
+ ],
16
+ "resample": 3,
17
+ "rescale_factor": 0.00392156862745098,
18
+ "size": {
19
+ "height": 224,
20
+ "width": 224
21
+ }
22
+ }
raw_checkpoint.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d4f12da88959104246da8fd8e984d8357136f5782bbf90cf698489de1f77647
3
+ size 460127254