Instructions to use facebook/ijepa_vith14_1k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/ijepa_vith14_1k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="facebook/ijepa_vith14_1k")# Load model directly from transformers import AutoImageProcessor, AutoModel processor = AutoImageProcessor.from_pretrained("facebook/ijepa_vith14_1k") model = AutoModel.from_pretrained("facebook/ijepa_vith14_1k", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -49,10 +49,12 @@ model_id = "jmtzt/ijepa_vith14_1k"
|
|
| 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)
|