CLIP
이미지 임베딩
#요청 페이로드 정의
infer_clip_payload = {
#이미지는 URL로 제공하거나 base64 인코딩된 문자열로 제공할 수 있습니다
"image": {
# "type"은 "base64"일 수도 있습니다
"type": "url",
# "value"는 이미지 데이터의 base64 인코딩 문자열일 수도 있습니다
"value": "https://images.freeimages.com/images/large-previews/36c/raccoons-in-the-wild-4-1624830.jpg",
},
}
# 인퍼런스 서버 URL 정의 (localhost:9001, infer.roboflow.com 등)
base_url = "https://infer.roboflow.com"
# 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)텍스트 임베딩
비교
Last updated
Was this helpful?