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

REST API와 함께 사용

Serverless Hosted API에는 모든 모델과 Workflows를 위한 하나의 엔드포인트가 있습니다:

https://serverless.roboflow.com

HTTP 엔드포인트

Legacy Infer From Request

post

Legacy inference endpoint for object detection, instance segmentation, and classification.

Args: background_tasks: (BackgroundTasks) pool of fastapi background tasks dataset_id (str): ID of a Roboflow dataset corresponding to the model to use for inference OR workspace ID version_id (str): ID of a Roboflow dataset version corresponding to the model to use for inference OR model ID api_key (Optional[str], default None): Roboflow API Key passed to the model during initialization for artifact retrieval. # Other parameters described in the function signature...

Returns: Union[InstanceSegmentationInferenceResponse, KeypointsDetectionInferenceRequest, ObjectDetectionInferenceResponse, ClassificationInferenceResponse, MultiLabelClassificationInferenceResponse, SemanticSegmentationInferenceResponse, Any]: The response containing the inference results.

Path parameters
dataset_idstringRequired

ID of a Roboflow dataset corresponding to the model to use for inference OR workspace ID

version_idstringRequired

ID of a Roboflow dataset version corresponding to the model to use for inference OR model ID

Query parameters
api_keystring · nullableOptional

Roboflow API Key that will be passed to the model during initialization for artifact retrieval

confidenceany ofOptional

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.

Default: 0.4
numberOptional
or
string · enumOptionalPossible values:
keypoint_confidencenumberOptional

The confidence threshold used to filter out keypoints that are not visible based on model confidence

Default: 0
formatstringOptional

One 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.

Default: json
imagestring · nullableOptional

The publically accessible URL of an image to use for inference.

image_typestring · nullableOptional

One of base64 or numpy. Note, numpy input is not supported for Roboflow Hosted Inference.

Default: base64
labelsboolean · nullableOptional

If true, labels will be include in any inference visualization.

Default: false
mask_decode_modestring · nullableOptional

One 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.

Default: accurate
tradeoff_factornumber · nullableOptional

The amount to tradeoff between 0='fast' and 1='accurate'

Default: 0
max_detectionsintegerOptional

The 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.

Default: 300
overlapnumberOptional

The IoU threhsold that must be met for a box pair to be considered duplicate during NMS

Default: 0.3
strokeintegerOptional

The stroke width used when visualizing predictions

Default: 1
disable_preproc_auto_orientboolean · nullableOptional

If true, disables automatic image orientation

Default: false
disable_preproc_contrastboolean · nullableOptional

If true, disables automatic contrast adjustment

Default: false
disable_preproc_grayscaleboolean · nullableOptional

If true, disables automatic grayscale conversion

Default: false
disable_preproc_static_cropboolean · nullableOptional

If true, disables automatic static crop

Default: false
disable_active_learningboolean · nullableOptional

If true, the predictions will be prevented from registration by Active Learning (if the functionality is enabled)

Default: false
active_learning_target_datasetstring · nullableOptional

Parameter to be used when Active Learning data registration should happen against different dataset than the one pointed by model_id

sourcestring · nullableOptional

The source of the inference request

Default: external
source_infostring · nullableOptional

The detailed source information of the inference request

Default: external
response_mask_formatstring · enum · nullableOptional

The format of the prediction mask - polygon (default) or rle - applicable for instance segmentation models.

Default: polygonPossible values:
Responses
200

Successful Response

application/json
or
or
or
or
or
or
or
anyOptional
post/{dataset_id}/{version_id}

마지막 업데이트

도움이 되었나요?