Update README.md
#2
by
valeriol29
- opened
README.md
CHANGED
@@ -41,7 +41,10 @@ url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
|
|
41 |
image = Image.open(requests.get(url, stream=True).raw)
|
42 |
|
43 |
processor = ViTImageProcessor.from_pretrained('facebook/dino-vits16')
|
44 |
-
model = ViTModel.from_pretrained(
|
|
|
|
|
|
|
45 |
|
46 |
inputs = processor(images=image, return_tensors="pt")
|
47 |
outputs = model(**inputs)
|
|
|
41 |
image = Image.open(requests.get(url, stream=True).raw)
|
42 |
|
43 |
processor = ViTImageProcessor.from_pretrained('facebook/dino-vits16')
|
44 |
+
model = ViTModel.from_pretrained(
|
45 |
+
'facebook/dino-vits16',
|
46 |
+
add_pooling_layer=True # Whether to initialize the ViTPooler module. Set it to 'False' to load only the backbone. 🤗
|
47 |
+
)
|
48 |
|
49 |
inputs = processor(images=image, return_tensors="pt")
|
50 |
outputs = model(**inputs)
|