For the complete documentation index, see llms.txt. This page is also available as Markdown.

コアモデル

inference-sdk の HTTP クライアントを通じて、同期・非同期メソッドで CLIP と DocTR の基盤モデルを呼び出します。

InferenceHTTPClient Inference でホストされるコアモデルをサポートします。これらのモデルの一部は、Roboflow のホスト型 inference プラットフォームで使用できます(use https://serverless.roboflow.com を URL として使用します);その他はローカルにデプロイできます(通常、ローカルサーバーは http://localhost:9001).

CLIP

from inference_sdk import InferenceHTTPClient

CLIENT = InferenceHTTPClient(
    api_url="http://localhost:9001",  # または "https://serverless.roboflow.com" を使ってホスト型サービングを利用
    api_key="ROBOFLOW_API_KEY"
)

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_typeprompt_type:

  • (画像, 画像) (デフォルト)

  • (画像, テキスト)

  • (テキスト, 画像)

  • (テキスト, テキスト)

非同期メソッドも利用できます:

以下を参照してください CLIP モデルリファレンス モデル自体の詳細については。

DocTR

非同期版: CLIENT.ocr_image_async(...)。詳しくは DocTR モデルリファレンス を使用します。詳しくは

Gaze(非推奨)

最終更新

役に立ちましたか?