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