Update README.md
Browse files
README.md
CHANGED
@@ -60,12 +60,11 @@ from PIL import Image
|
|
60 |
text = 'a small red panda in a zoo'
|
61 |
image = Image.open('red_panda.jpg')
|
62 |
|
63 |
-
image_data =
|
64 |
-
text_data =
|
65 |
|
66 |
-
image_embedding = model.encode_image(image_data)
|
67 |
-
text_embedding = model.encode_text(text_data)
|
68 |
-
joint_embedding = model.encode_multimodal(image=image_data, text=text_data)
|
69 |
```
|
70 |
|
71 |
To get features:
|
|
|
60 |
text = 'a small red panda in a zoo'
|
61 |
image = Image.open('red_panda.jpg')
|
62 |
|
63 |
+
image_data = processor.preprocess_image(image)
|
64 |
+
text_data = processor.preprocess_text(text)
|
65 |
|
66 |
+
image_features, image_embedding = model.encode_image(image_data, return_features=True)
|
67 |
+
text_features, text_embedding = model.encode_text(text_data, return_features=True)
|
|
|
68 |
```
|
69 |
|
70 |
To get features:
|