Update README.md
Browse files
README.md
CHANGED
@@ -49,10 +49,12 @@ model_id = "jmtzt/ijepa_vith14_22k"
|
|
49 |
processor = AutoProcessor.from_pretrained(model_id)
|
50 |
model = AutoModel.from_pretrained(model_id)
|
51 |
|
|
|
52 |
def infer(image):
|
53 |
inputs = processor(image, return_tensors="pt")
|
54 |
outputs = model(**inputs)
|
55 |
-
return outputs.
|
|
|
56 |
|
57 |
embed_1 = infer(image_1)
|
58 |
embed_2 = infer(image_2)
|
|
|
49 |
processor = AutoProcessor.from_pretrained(model_id)
|
50 |
model = AutoModel.from_pretrained(model_id)
|
51 |
|
52 |
+
|
53 |
def infer(image):
|
54 |
inputs = processor(image, return_tensors="pt")
|
55 |
outputs = model(**inputs)
|
56 |
+
return outputs.last_hidden_state.mean(dim=1)
|
57 |
+
|
58 |
|
59 |
embed_1 = infer(image_1)
|
60 |
embed_2 = infer(image_2)
|