서버리스 클라우드 API
Roboflow 클라우드의 GPU 가속 자동 확장 인프라에서 워크플로와 모델 추론을 실행합니다.
소개
Inference 서버
from inference_sdk import InferenceHTTPClient
CLIENT = InferenceHTTPClient(
# api_url="http://localhost:9001" # 자체 호스팅된 Inference 서버
api_url="https://serverless.roboflow.com", # 우리의 Serverless Cloud API
api_key="API_KEY" # 비공개 모델과 데이터에 접근하기 위한 선택 사항
)
result = CLIENT.infer("image.jpg", model_id="model-id/1")
print(result)제한 사항
HTTP API
REST API와 함께 사용
HTTP 엔드포인트
ID of a Roboflow dataset corresponding to the model to use for inference OR workspace ID
ID of a Roboflow dataset version corresponding to the model to use for inference OR model ID
Roboflow API Key that will be passed to the model during initialization for artifact retrieval
The confidence threshold used to filter out predictions. Pass a float in [0, 1], or "best" to use F1-optimal thresholds from model evaluation, or "default" to use the model's built-in default.
0.4The confidence threshold used to filter out keypoints that are not visible based on model confidence
0One of 'json' or 'image'. If 'json' prediction data is return as a JSON string. If 'image' prediction data is visualized and overlayed on the original input image.
jsonThe publically accessible URL of an image to use for inference.
One of base64 or numpy. Note, numpy input is not supported for Roboflow Hosted Inference.
base64If true, labels will be include in any inference visualization.
falseOne of 'accurate' or 'fast'. If 'accurate' the mask will be decoded using the original image size. If 'fast' the mask will be decoded using the original mask size. 'accurate' is slower but more accurate.
accurateThe amount to tradeoff between 0='fast' and 1='accurate'
0The maximum number of detections to return. This is used to limit the number of predictions returned by the model. The model may return more predictions than this number, but only the top max_detections predictions will be returned.
300The IoU threhsold that must be met for a box pair to be considered duplicate during NMS
0.3The stroke width used when visualizing predictions
1If true, disables automatic image orientation
falseIf true, disables automatic contrast adjustment
falseIf true, disables automatic grayscale conversion
falseIf true, disables automatic static crop
falseIf true, the predictions will be prevented from registration by Active Learning (if the functionality is enabled)
falseParameter to be used when Active Learning data registration should happen against different dataset than the one pointed by model_id
The source of the inference request
externalThe detailed source information of the inference request
externalThe format of the prediction mask - polygon (default) or rle - applicable for instance segmentation models.
polygonPossible values: Successful Response
Validation Error
POST /{dataset_id}/{version_id} HTTP/1.1
Accept: */*
{
"visualization": "text",
"inference_id": "text",
"frame_id": 1,
"time": 1,
"image": [
{
"width": 1,
"height": 1
}
],
"predictions": [
{
"x": 1,
"y": 1,
"width": 1,
"height": 1,
"confidence": 1,
"class": "text",
"class_id": 1,
"detection_id": "text",
"parent_id": "text",
"class_confidence": 1,
"points": [
{
"x": 1,
"y": 1
}
],
"mask_format": "polygon"
}
]
}이미지에서 모델 실행하기
추론 런타임
Serverless Cloud API 호출하기
사용 중단됨: Serverless v1
Python SDK
Python SDK와 함께 사용
Roboflow Instant Model
Python SDK로 비디오 스트리밍
CLI
명령
옵션
예시
JSON 출력
마지막 업데이트
도움이 되었나요?