fix naming in docs
Browse files
experimental/clip_app_client.py
CHANGED
@@ -13,17 +13,17 @@ class ClipAppClient:
|
|
13 |
"""
|
14 |
A class to handle generating embeddings using the OpenAI CLIP model.
|
15 |
|
16 |
-
|
17 |
|
18 |
test_image_url = "https://example.com/image.jpg"
|
19 |
-
preprocessed_image =
|
20 |
|
21 |
text = "A beautiful landscape"
|
22 |
-
text_embeddings =
|
23 |
|
24 |
-
image_embeddings =
|
25 |
|
26 |
-
preprocessed_image_embeddings =
|
27 |
"""
|
28 |
|
29 |
def __init__(self, clip_model="ViT-L/14", device=None):
|
|
|
13 |
"""
|
14 |
A class to handle generating embeddings using the OpenAI CLIP model.
|
15 |
|
16 |
+
app_client = ClipAppClient()
|
17 |
|
18 |
test_image_url = "https://example.com/image.jpg"
|
19 |
+
preprocessed_image = app_client.preprocess_image(test_image_url)
|
20 |
|
21 |
text = "A beautiful landscape"
|
22 |
+
text_embeddings = app_client.text_to_embedding(text)
|
23 |
|
24 |
+
image_embeddings = app_client.image_url_to_embedding(test_image_url)
|
25 |
|
26 |
+
preprocessed_image_embeddings = app_client.preprocessed_image_to_embedding(preprocessed_image)
|
27 |
"""
|
28 |
|
29 |
def __init__(self, clip_model="ViT-L/14", device=None):
|