---
title: "Image segmentation"
method: POST
path: "/image/segmentation"
tags: ["Plugin API/Model/Image"]
---

# Image segmentation

`POST /image/segmentation`

This API integrates your Image segmentation model into BasicAI. This API only works with Image datasets.

## Headers

- `Authorization` string

## Request body

- object
  - `data` ImageModelData, required
    - `id` integer, required — ID
    - `url` string, required — URL

## Response `200`

Successful

- object
  - `code` string, required — Error code, OK indicates success, while others indicate failure
  - `message` string, required — Error message
  - `data` object, required — Null, if there is none
    - `objects` ImageModelSegmentationObject[], required — An array of the segmentation objects，will be null or an empty array if there is none
      - `label` object, required — Class or label
        - `id` integer, required — ID，start from 1
        - `name` string, required — Name, case sensitive
      - `area` number — The number of included pixels. If empty, related QA will not be supported.
    - `labelmap` string, required — Tag map, PNG RGB 24-bit image format, has undergone Base64 encoding, marking the label ID of each pixel

---

[API](https://skmtc.dev/basic/apis/basicai-cloud-open-plugin-api.md) · [All operations](https://skmtc.dev/basic/apis/basicai-cloud-open-plugin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/basic/basicai-cloud-open-plugin-api/revisions/f6b5a226c6da/schema)
