Neidio i'r cynnwys

Segment Anything Model 2 · Auto Segment

Integreiddio

ID y model 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.com/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.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Y cais hwn: ≈$0.014 14 o gredydau API Ei redeg ar y dudalen hon

Cael allwedd API
Meta Golygu Delweddau #segmentation#mask

Segmentu awtomatig delwedd gyfan sy'n dychwelyd masgiau unigol ynghyd â masg cyfun

Meta · Data (JSON)

Mae eich canlyniad cyntaf yn mynd yma

Adeiladwch gais isod a'i redeg gyda'ch allwedd API. Mae allbynnau'n cael eu copïo i'n storio, wedi'u cadw am byth neu am 7 diwrnod am ddim.

Adeiladu cais

Cynhyrchir rheolyddion o sgema'r model. Mae'r cod a'r pris yn diweddaru wrth i chi eu newid.

•gofynnol image_url
Gollyngwch ffeil, neu

URL delwedd ar gyfer segmentu awtomatig.

Uwch output_format · points_per_side · pred_iou_thresh · stability_score_thresh · min_mask_region_area
output_format rhagosodedig png

Fformat ffeil y ddelwedd sy'n deillio.

rhagosodedig 32

Nifer y pwyntiau sampl ar hyd pob ochr delwedd.

rhagosodedig 0.88

Trothwy a ddefnyddir ar y sgôr IOU a ragfynegir.

rhagosodedig 0.95

Trothwy a ddefnyddir ar y sgôr sefydlogrwydd.

rhagosodedig 100

Arwynebedd rhanbarth mwgwd lleiaf a ganiateir.

POST /run/sam2/auto-segment?wait=20 dyfynbris → $0.014
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/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.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Rhedeg y cais hwn

Mae'ch allwedd yn aros yn y porwr hwn: caiff ei hanfon at Doitong API yn unig a'i chadw (localStorage) dim ond os ticiwch Cofio. Cael allwedd API

Ynglŷn â Segment Anything Model 2 · Auto Segment

Yn segmentu delwedd o `image_url` heb unrhyw anogwyr, gan ddychwelyd un masg cyfun ac arae o fasgiau unigol. Addaswch y canfod gyda `points_per_side` (diofyn 32), `pred_iou_thresh`, `stability_score_thresh` a `min_mask_region_area`. Gellir cadw delweddau masg fel png neu jpeg.

Paramedrau

Anfonwch naill ai'r enw canonaidd neu'r enw brodorol, nid y ddau. Enwau canonaidd

EnwMath RhagosodedigCaniateir Disgrifiad
image_urlgofynnol image
Mathurl · image
URL delwedd ar gyfer segmentu awtomatig.
output_formatdewisol
Mathenum
Rhagosodedigpng
jpegpng
Fformat ffeil y ddelwedd sy'n deillio.
points_per_sidedewisol
Mathinteger
Rhagosodedig32
Nifer y pwyntiau sampl ar hyd pob ochr delwedd.
pred_iou_threshdewisol
Mathnumber
Rhagosodedig0.88
Trothwy a ddefnyddir ar y sgôr IOU a ragfynegir.
stability_score_threshdewisol
Mathnumber
Rhagosodedig0.95
Trothwy a ddefnyddir ar y sgôr sefydlogrwydd.
min_mask_region_areadewisol
Mathinteger
Rhagosodedig100
Arwynebedd rhanbarth mwgwd lleiaf a ganiateir.
gofynnol Enw canonaidd, derbyniol hefyd

Mae paramedrau ffeil yn derbyn URL cyhoeddus https://, URI data: hyd at 10 MB, neu file_url uwchlwythiad. Ffeiliau

Allbwn

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.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Eich ffeiliau, eich dewisMae pob outputs[].url yn gopi ar ein storio: wedi'i gadw am byth (telir fesul GB-mis) neu am 7 diwrnod am ddim, yn ôl gosodiad eich cyfrif neu ?storage=.
Yr un siâp ar bob modeltype, url, content_type, width, height a duration, ar gyfer delweddau, fideo a sain fel ei gilydd. Gwrthrych canlyniad y model ei hun yw output.
Meysydd yr allbwn
combined_mask
object {url, content_type, file_name, file_size, width, height}Mwgwd segmentu sy'n cyfuno'r canlyniadau.
individual_masks
array of object {url, content_type, file_name, file_size, width, height}Masgiau ar wahân ar gyfer segmentau unigol.

Mwy o fodelau: Golygu Delweddau

Ar gyfer asiantau AI: mae'r dudalen hon fel Markdown ar gael yn https://doitong.com/cy/developers/models/sam2/auto-segment.md. Pob model a chanllaw: https://doitong.com/developers/llms.txt