핵심 모델
동기 및 비동기 메서드를 사용하여 inference-sdk HTTP 클라이언트로 CLIP 및 DocTR 기반 모델을 호출하세요.
InferenceHTTPClient Inference에서 호스팅되는 핵심 모델을 지원합니다. 이러한 모델 중 일부는 Roboflow 호스팅 추론 플랫폼에서 사용할 수 있습니다(사용 https://serverless.roboflow.com 을 URL로 사용); 다른 모델은 로컬에 배포할 수 있습니다(일반적으로 로컬 서버는 다음에서 사용할 수 있습니다 http://localhost:9001).
CLIP
from inference_sdk import InferenceHTTPClient, InferenceConfiguration
CLIENT = InferenceHTTPClient(
api_url="http://localhost:9001", # 또는 호스팅 서빙을 사용하려면 "https://serverless.roboflow.com"
api_key="ROBOFLOW_API_KEY"
).configure(InferenceConfiguration(api_key_transport="header"))
CLIENT.get_clip_image_embeddings(inference_input="./my_image.jpg") # 단일 이미지 요청
CLIENT.get_clip_image_embeddings(inference_input=["./my_image.jpg", "./other_image.jpg"]) # 배치 이미지 요청
CLIENT.get_clip_text_embeddings(text="some") # 단일 텍스트 요청
CLIENT.get_clip_text_embeddings(text=["some", "other"]) # 다른 텍스트 요청
CLIENT.clip_compare(
subject="./my_image.jpg",
prompt=["fox", "dog"],
)해당 CLIENT.clip_compare(...) 메서드는 다양한 조합을 비교할 수 있게 해줍니다 subject_type 및 prompt_type:
(image, image)(기본값)(image, text)(text, image)(text, text)
비동기 메서드도 사용할 수 있습니다:
다음을 참조하세요 CLIP 모델 참조 모델 자체에 대한 자세한 내용은 다음에서 확인하세요.
DocTR
비동기 대응: CLIENT.ocr_image_async(...). 다음을 참조하세요 DocTR 모델 참조 자세한 내용은 다음에서 확인하세요.
Gaze(사용 중단됨)
마지막 업데이트
도움이 되었나요?