Segment objects in an image

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:

  • Must have file extension: .jpeg, .jpg or .png
  • Must have image/png or image/jpeg as mimeType

Available only when the cdf-version: beta header is provided.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
header Parameters
cdf-version
string

cdf version header. Use this to specify the requested CDF release.

Example: alpha
Request Body schema: application/json
required

A request for running an segment job.

Any of:
required
Array of 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.

Responses
200

Success

400

The response for a failed request.

post/context/vision/segment
Request samples
application/json
{
  • "items": [
    • {
      }
    ],
  • "points": [
    • {
      }
    ],
  • "boundingBox": {
    • "xMin": 0.1,
    • "yMin": 0.2,
    • "xMax": 0.5,
    • "yMax": 0.6
    }
}
Response samples
application/json
{
  • "status": "Queued",
  • "createdTime": 0,
  • "startTime": 0,
  • "statusTime": 0,
  • "errorMessage": null,
  • "jobId": 123,
  • "items": [
    • {
      }
    ],
  • "points": [
    • {
      }
    ],
  • "boundingBox": {
    • "xMin": 0.1,
    • "yMin": 0.2,
    • "xMax": 0.5,
    • "yMax": 0.6
    }
}