CLIP
Embed Image
#Define Request Payload
infer_clip_payload = {
#Images can be provided as urls or as base64 encoded strings
"image": {
# "type" also can be "base64"
"type": "url",
# "value" also can be a base64 encoded string of image data
"value": "https://images.freeimages.com/images/large-previews/36c/raccoons-in-the-wild-4-1624830.jpg",
},
}
# Define inference server url (localhost:9001, infer.roboflow.com, etc.)
base_url = "https://infer.roboflow.com"
# Define your Roboflow API Key
api_key = <YOUR API KEY HERE>
res = requests.post(
f"{base_url}/clip/embed_image?api_key={api_key}",
json=infer_clip_payload,
)
embeddings = res.json()['embeddings']
print(embeddings)Embed Text
Compare
Last updated
Was this helpful?