Spaces:
Runtime error
Runtime error
Samuel Schmidt
commited on
Commit
·
7db538c
1
Parent(s):
fbfbcf2
Fix: image feature calculated
Browse files- src/CLIP.py +3 -3
src/CLIP.py
CHANGED
@@ -19,9 +19,9 @@ class CLIPImageEncoder:
|
|
19 |
print(images)
|
20 |
input = self.processor(images=images, return_tensors="pt")
|
21 |
with torch.no_grad():
|
22 |
-
|
23 |
-
image_features = self.model(**input).last_hidden_state[:,0].cpu()
|
24 |
print(image_features)
|
25 |
print("--------------------")
|
26 |
print(self.model.get_image_features(**input).cpu().detach().numpy()[0])
|
27 |
-
return {"clip_embeddings": image_features}
|
|
|
19 |
print(images)
|
20 |
input = self.processor(images=images, return_tensors="pt")
|
21 |
with torch.no_grad():
|
22 |
+
image_features = self.model.get_image_features(**input)
|
23 |
+
#image_features = self.model(**input).last_hidden_state[:,0].cpu()
|
24 |
print(image_features)
|
25 |
print("--------------------")
|
26 |
print(self.model.get_image_features(**input).cpu().detach().numpy()[0])
|
27 |
+
return {"clip_embeddings": image_features.cpu().detach().numpy()[0]}
|