Njuolgga sisdollui

Segment Anything Model 2 · Auto Segment

Integrere

Modealla-id 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"

Dát ohcamuš: ≈0,014 $ 14 API-kreditta Vuodje dán siiddu alde

Oza API-čoavdaga
Meta Gova heiveheapmi #segmentation#mask

Automáhtalaš olles-govvasegmenteren, mii máhccá sierra maskkaid ja oktasaš maskka

Meta · Diehtu (JSON)

Dát lea du vuosttaš bohtos

Daga jearaldaga vuolábealde ja vuodje dan iežat API-čoavddain. Boađusat kopierejuvvojit min vurkemii, bisuhuvvojit álo dahje 7 beaivvi nuvttá.

Ráhkat jearaldaga

Kontrollat ráhkaduvvojit modealla skeama vuođul. Koda ja haddi ođasmahttojuvvojit go rievddadat daid.

•gáibiduvvo image_url
Luoitte fiilla, dahje

Gova URL automáhtalaš segmenteremii.

Viiddiduvvon output_format · points_per_side · pred_iou_thresh · stability_score_thresh · min_mask_region_area
output_format standárda png

Boahtteva govva fiilaformáhtta.

standárda 32

Ovdamearkkačuoggáid lohku juohke gova bealde.

standárda 0.88

Čuozahus meroštallojuvvon IOU-score:i várás.

standárda 0.95

Čuozahus stabiilvuođascora várás.

standárda 100

Unnimus dohkálaš maskaguovllu areála.

POST /run/sam2/auto-segment?wait=20 haddemearrádus → 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"

Geavat dán ohcamuša

Du key báhcá dán fierpmádatlogan: dat sáddejuvvo dušše Doitong API:ii ja vurkejuvvo (localStorage) dušše jos válljet Remember. Viečča API-keya

Dát lea Segment Anything Model 2 · Auto Segment birra

Segmentere govvagova `image_url`-s promptta haga, ja máhccá ovtta oktasaš maskka ja sierra maskkaid array:a. Heive detešuvnna `points_per_side`-in (standárda 32), `pred_iou_thresh`, `stability_score_thresh` ja `min_mask_region_area`. Maskegovat sáhttet vurkejuvvot png- dahje jpeg-formáhtas.

Parametterat

Sádde kanonala nama dahje iežas nama, ii goappašiid. Kanonala namat

NammaŠládja StandárdaDohkkehuvvon Govvádus
image_urlgáibiduvvo image
Šládjaurl · image
Gova URL automáhtalaš segmenteremii.
output_formateaktodáhtolaš
Šládjaenum
Standárdapng
jpegpng
Boahtteva govva fiilaformáhtta.
points_per_sideeaktodáhtolaš
Šládjainteger
Standárda32
Ovdamearkkačuoggáid lohku juohke gova bealde.
pred_iou_thresheaktodáhtolaš
Šládjanumber
Standárda0.88
Čuozahus meroštallojuvvon IOU-score:i várás.
stability_score_thresheaktodáhtolaš
Šládjanumber
Standárda0.95
Čuozahus stabiilvuođascora várás.
min_mask_region_areaeaktodáhtolaš
Šládjainteger
Standárda100
Unnimus dohkálaš maskaguovllu areála.
gáibiduvvo Kanonala namma, maid sáhttá geavahit

Fiilaparametterat váldet almmolaš https:// URL:a, data: URI:a gitta 10 MB, dahje uploada file_url:a. Fiillat

Boađus

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"
  }
}
Du fiillat, du válljenJuohke outputs[].url lea kopia min vurkemis: bisuhuvvo álo (mákso GB-mánu mielde) dahje 7 beaivvi nuvttá, du konto­o heiveheami dahje ?storage= mielde.
Seammá hápmi juohke modeallastype, url, content_type, width, height ja duration, govvii, videoii ja jienai seammá ládje. output lea modealla iežas boađusobjekta.
Outputa giettit
combined_mask
object {url, content_type, file_name, file_size, width, height}Segmenterenmaskka, mii ovttastahttá boađusiid.
individual_masks
array of object {url, content_type, file_name, file_size, width, height}Sierra maskkat ovttaskas segmenttaid várás.

Eanet modeallat: Gova heiveheapmi

AI-agenttaide: dán siidu Markdowna lea dáppe https://doitong.com/se/developers/models/sam2/auto-segment.md. Buot modeallat ja ráđit: https://doitong.com/developers/llms.txt