IMvision12 commited on
Commit
3bd90f6
verified
1 Parent(s): 4b12065

fix readme.md

Browse files
Files changed (1) hide show
  1. README.md +4 -3
README.md CHANGED
@@ -25,7 +25,8 @@ tags:
25
 
26
  Paper: [DINOv2: Learning Robust Visual Features without Supervision (arXiv:2304.07193)](https://arxiv.org/abs/2304.07193) 路 [HF Papers](https://huggingface.co/papers/2304.07193)
27
 
28
- DINOv2 scales self-supervised ViT pretraining for strong transferable visual features without labels. These checkpoints are backbones that return patch tokens for downstream heads.\n
 
29
  For more details on the model, please go to the upstream [model card](https://huggingface.co/facebook/dinov2-base).
30
 
31
  Pure-**Keras 3** conversion of [`facebook/dinov2-base`](https://huggingface.co/facebook/dinov2-base) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
@@ -40,9 +41,9 @@ os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
40
 
41
  import numpy as np
42
  from PIL import Image
43
- from {meta['import_path']} import {meta['load_cls']}
44
 
45
- model = {meta["load_cls"]}.from_weights("kerasformers/{variant}", image_size=448)
46
  image = Image.open("your_image.jpg").convert("RGB")
47
  x = np.asarray(image.resize((448, 448)))[None].astype("float32")
48
  tokens = model(x, training=False)
 
25
 
26
  Paper: [DINOv2: Learning Robust Visual Features without Supervision (arXiv:2304.07193)](https://arxiv.org/abs/2304.07193) 路 [HF Papers](https://huggingface.co/papers/2304.07193)
27
 
28
+ DINOv2 scales self-supervised ViT pretraining for strong transferable visual features without labels. These checkpoints are backbones that return patch tokens for downstream heads.
29
+
30
  For more details on the model, please go to the upstream [model card](https://huggingface.co/facebook/dinov2-base).
31
 
32
  Pure-**Keras 3** conversion of [`facebook/dinov2-base`](https://huggingface.co/facebook/dinov2-base) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
 
41
 
42
  import numpy as np
43
  from PIL import Image
44
+ from kerasformers.models.dino_v2 import DinoV2Model
45
 
46
+ model = DinoV2Model.from_weights("kerasformers/dinov2_vitb14", image_size=448)
47
  image = Image.open("your_image.jpg").convert("RGB")
48
  x = np.asarray(image.resize((448, 448)))[None].astype("float32")
49
  tokens = model(x, training=False)