Start an asynchronous prediction job for segmenting an image, given a set of prompt points and/or a bounding box. Providing more points on the object you want to segment can improve the result. Furthermore, point prompts can be given a label (0 or 1) which specifies whether the the point should be considered as a foreground or a background point. The response of the POST request contains a job ID, which can be used to make subsequent (GET) calls to check the status and retrieve the results of the job (see Retrieve results from a segmentation job).
The files referenced by items
in the request body must fulfill the following requirements:
.jpeg
, .jpg
or .png
image/png
or image/jpeg
as mimeType
Available only when the cdf-version: beta
header is provided.
A request for running an segment job.
required | Array of objects or objects or objects (FileReference) [ 1 .. 1 ] List of image files to be segmented. Currently supporting only one image. |
required | Array of objects (SegmentPoint) unique Prompt points. |
object (SegmentBoundingBox) Box prompt. |
Success
The response for a failed request.
{- "items": [
- {
- "fileId": 1234
}
], - "points": [
- {
- "x": 0.8,
- "y": 0.8,
- "label": 1
}
], - "boundingBox": {
- "xMin": 0.1,
- "yMin": 0.2,
- "xMax": 0.5,
- "yMax": 0.6
}
}
{- "status": "Queued",
- "createdTime": 1730204346000,
- "startTime": 1730204346000,
- "statusTime": 1730204346000,
- "errorMessage": null,
- "jobId": 123,
- "items": [
- {
- "fileId": 1234,
- "fileExternalId": "1234",
- "fileInstanceId": {
- "space": "space",
- "externalId": "externalId"
}
}
], - "points": [
- {
- "x": 0.8,
- "y": 0.8,
- "label": 1
}
], - "boundingBox": {
- "xMin": 0.1,
- "yMin": 0.2,
- "xMax": 0.5,
- "yMax": 0.6
}
}