Leum chun t-susbaint

Segment Anything Model 2 · Auto Segment

Amalaich

ID a’ mhodail sam2/auto-segment
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/sam2/auto-segment?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

An t-iarrtas seo: ≈$0.014 14 creideasan API · ≈ ₽1.48 Ruith e air an duilleig seo

Faigh iuchair API
Meta Deasachadh Ìomhaighean #segmentation#mask

Sgaradh fèin-obrachail na h-ìomhaigh air fad a thilleas masgan fa leth agus masg co-mheasgaichte

Meta · Dàta (JSON)

Thèid a’ chiad toradh agad an-seo

Tog iarrtas gu h-ìosal agus ruith e leis an iuchair API agad. Tha na h-às-churan air an lethbhreacadh dhan stòradh againn, air an cumail gu bràth no 7 latha an-asgaidh.

Tog iarrtas

Tha na smachdan air an cruthachadh bho sgeama a’ mhodail. Bidh an còd agus a’ phrìs ag ùrachadh fhad ’s a dh’atharraicheas tu iad.

•riatanach image_url
Leig às faidhle, no

URL ìomhaigh airson sgaradh fèin-obrachail.

Adhartach output_format · points_per_side · pred_iou_thresh · stability_score_thresh · min_mask_region_area
output_format bun-roghainn png

Cruth faidhle na h-ìomhaigh a thig às.

bun-roghainn 32

Àireamh phuingean sampaill air gach taobh den ìomhaigh.

bun-roghainn 0.88

Crìoch air a cur an sàs don sgòr IOU a chaidh a ro-innse.

bun-roghainn 0.95

Crìoch air a cur an sàs don sgòr seasmhachd.

bun-roghainn 100

An raon masg as lugha a tha ceadaichte.

POST /run/sam2/auto-segment?wait=20 tuairmse → $0.014
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/sam2/auto-segment?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Ruith an t-iarrtas seo

Fuirichidh an iuchair agad sa bhrobhsair seo: thèid a cur chun Doitong API a-mhàin agus a sàbhaladh (localStorage) a-mhàin ma chuireas tu comharra ri Cuimhnich. Faigh iuchair API

Mu Segment Anything Model 2 · Auto Segment

Sgaraich ìomhaigh bho `image_url` gun promptan sam bith, a’ tilleadh aon masg co-mheasgaichte agus sreath de mhasgan fa leth. Atharraich lorg le `points_per_side` (bunaiteach 32), `pred_iou_thresh`, `stability_score_thresh` agus `min_mask_region_area`. Faodar ìomhaighean masg a shàbhaladh mar png no jpeg.

Paramadairean

Cuir an t-ainm canonical no an t-ainm dùthchasach, chan e an dà chuid. Ainmean canonical

AinmSeòrsa Bun-roghainnCeadaichte Tuairisgeul
image_urlriatanach image
Seòrsaurl · image
URL ìomhaigh airson sgaradh fèin-obrachail.
output_formatroghainneil
Seòrsaenum
Bun-roghainnpng
jpegpng
Cruth faidhle na h-ìomhaigh a thig às.
points_per_sideroghainneil
Seòrsainteger
Bun-roghainn32
Àireamh phuingean sampaill air gach taobh den ìomhaigh.
pred_iou_threshroghainneil
Seòrsanumber
Bun-roghainn0.88
Crìoch air a cur an sàs don sgòr IOU a chaidh a ro-innse.
stability_score_threshroghainneil
Seòrsanumber
Bun-roghainn0.95
Crìoch air a cur an sàs don sgòr seasmhachd.
min_mask_region_arearoghainneil
Seòrsainteger
Bun-roghainn100
An raon masg as lugha a tha ceadaichte.
riatanach Ainm canonical, gabhar ris cuideachd

Gabhaidh paramadairean faidhle ri URL poblach https://, URI data: suas ri 10 MB, no file_url de luchdachadh suas. Faidhlichean

Toradh

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "sam2/auto-segment",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 14,
    "usd": "0.014",
    "charged": 14,
    "refunded": 0
  },
  "input": {
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "output": {
    "combined_mask": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768
    },
    "individual_masks": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ]
  },
  "outputs": [
    {
      "type": "file",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Na faidhlichean agad, do roghainnTha gach outputs[].url na lethbhreac air an stòradh againn: air a chumail gu bràth (air a phàigheadh gach GB-mìos) no 7 latha an-asgaidh, a rèir suidheachadh a’ chunntais agad no ?storage=.
An aon chruth air gach modailtype, url, content_type, width, height agus duration, airson dealbhan, bhidio agus fuaim le chèile. ’S e output nì toraidh a’ mhodail fhèin.
Raointean toraidh
combined_mask
object {url, content_type, file_name, file_size, width, height}Masg sgaraidh a’ cothlamadh nan toraidhean.
individual_masks
array of object {url, content_type, file_name, file_size, width, height}Masgan fa leth airson earrannan fa leth.

Barrachd mhodalan: Deasachadh Ìomhaighean

Do riochdairean AI: tha an duilleag seo mar Markdown aig https://doitong.com/gd/developers/models/sam2/auto-segment.md. Na modailean agus na treòraichean uile: https://doitong.com/developers/llms.txt