Run an Instant Model

Python SDK と Serverless Hosted API V2 を使用して Roboflow Instant モデルを実行できます。

Instant モデルを実行するには、次のコードを使用します:

from inference_sdk import InferenceHTTPClient, InferenceConfiguration

CLIENT = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key="<Your API Key>",
    
)

configuration = InferenceConfiguration(
    confidence_threshold=0.95
)

CLIENT.configure(configuration)

result = client.infer("image.jpeg", model_id="model-id/1")

print(result)

上記で、次を指定してください: model ID および API key.

このコードはモデルを実行し、結果を返します。

Confidence threshold は Instant モデルで敏感になることがあります。最適な閾値はモデルが学習した画像の数に依存します。最適な confidence thresholds は通常 0.85 ~ 0.99 の範囲です。

Last updated

Was this helpful?