post/segment

Request

Request body

image_b64string nullable required

The image which should be segmented.

image_urlstring nullable

If given, download image_b64 from this URL.

max_num_boundsinteger nullable

The maximum number of Bounds to use when prompt is supplied. When more Bounds than this are generated, the extra lowest-scoring ones will be dropped. When set to 0, all generated Bounds are used.

max_num_masksinteger

The maximum number of masks generated for each request or, if prompt is specified, for each Bound generated. If 0, all masks are returned.

promptstring nullable

When given, a prompt that describes the object in the image that should be segmented. A mask will be generated to match this object. Only one of prompt, bounding_box, and point may be given.

prompt_object_detection_thresholdnumber

When prompt is specified, an object detection model produces a list of bounding boxes that enclose objects described by the prompt. Each bounding box is given a score. Only boxes which score above this threshold are reported.

prompt_token_detection_thresholdnumber

When prompt is specified, an object detection model produces a list of bounding boxes that enclose objects described by the prompt. Each token in the prompt is scored against the bounding box, and those exceeding this threshold are included in summary text. This allows a single prompt to describe multiple unrelated objects while preserving the ability for users to determine which object a box belongs to.

Response

Successful Response

removed_for_safetyboolean required

True if the input image was removed for safety, False otherwise.

Changes