Image Feature Extraction
Transformers
Safetensors
ijepa
Inference Endpoints
jmtzt commited on
Commit
ba3c451
1 Parent(s): 365fd12

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -1
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.pooler_output
 
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)