Peke ki ngā ihirangi

Segment Anything Model 2 · Auto Segment

Whakauru

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

Tēnei tono: ≈$ 0.014 14 whiwhinga API Whakahaerehia ki tēnei whārangi

Tikina he kī API
Meta Whakatika Atahanga #segmentation#mask

Wehewehenga aunoa o te whakaahua katoa, ka whakahoki kopare takitahi me tētahi kopare whakakotahi

Meta · Raraunga (JSON)

Kei konei tō hua tuatahi

Hangaia he tono ki raro nei, ka whakahaere mā tō kī API. Ka tāruatia ngā putanga ki tō mātou rokiroki, ka puritia mō ake tonu atu, mō rānei 7 rā mō te kore utu.

Hangaia he tono

Ka hangaia ngā mana whakahaere mai i te aronuinga o te tauira. Ka whakahoungia te waehere me te utu ina whakarerekē koe.

•e hiahiatia ana image_url
Whakataka he kōnae,

URL atahanga mō te wehewehenga aunoa.

Arā atu output_format · points_per_side · pred_iou_thresh · stability_score_thresh · min_mask_region_area
output_format taunoa png

Te hōputu kōnae mō te atahanga ka puta.

taunoa 32

Te maha o ngā ira tauira i te taha o ia taha atahanga.

taunoa 0.88

Te paepae ka hoatu ki te kaute IOU matapae.

taunoa 0.95

Te paepae ka hoatu ki te kaute pūmautanga.

taunoa 100

Te horahanga iti rawa e whakaaetia ana mō te rohe kanohi huna.

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

Whakahaerehia tēnei tono

Ka noho tō kī ki tēnei pūtirotiro: ka tukuna ki te Doitong API anake, ā, ka tiakina ki te localStorage anake ina tohua e koe te Mahara. Tikina he kī API

Mō Segment Anything Model 2 · Auto Segment

Ka wehewehe i tētahi whakaahua mai i `image_url` me te kore akiaki, ka whakahoki i tētahi kopare whakakotahi me tētahi huinga kopare takitahi. Whakaritea te kitenga mā `points_per_side` (taunoa 32), `pred_iou_thresh`, `stability_score_thresh` me `min_mask_region_area`. Ka taea te tiaki whakaahua kopare hei png, jpeg rānei.

Ngā tawhā

Tukuna te ingoa tōmua, te ingoa taketake rānei, kaua e rua. Ngā ingoa tōmua

IngoaMomo TaunoaE whakaaetia ana Whakamārama
image_urle hiahiatia ana image
Momourl · image
URL atahanga mō te wehewehenga aunoa.
output_formatkōwhiringa
Momoenum
Taunoapng
jpegpng
Te hōputu kōnae mō te atahanga ka puta.
points_per_sidekōwhiringa
Momointeger
Taunoa32
Te maha o ngā ira tauira i te taha o ia taha atahanga.
pred_iou_threshkōwhiringa
Momonumber
Taunoa0.88
Te paepae ka hoatu ki te kaute IOU matapae.
stability_score_threshkōwhiringa
Momonumber
Taunoa0.95
Te paepae ka hoatu ki te kaute pūmautanga.
min_mask_region_areakōwhiringa
Momointeger
Taunoa100
Te horahanga iti rawa e whakaaetia ana mō te rohe kanohi huna.
e hiahiatia ana Ingoa tōmua, e whakaaetia ana hoki

Mō ngā tawhā kōnae, whakamahia he URL tūmatanui https://, he URI data: tae atu ki te 10 MB, he file_url rānei o tētahi tukuake. Ngā kōnae

Putanga

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"
  }
}
Ō kōnae, māu e whiriwhiriKo ia url o outputs[] he tārua kei tō mātou rokiroki: ka puritia mō ake tonu atu (ka utua ia GB-marama) mō rānei 7 rā mō te kore utu, e ai ki ngā tautuhinga o tō pūkete, ki te ?storage= rānei.
He ōrite te hanga ki ia tauiratype, url, content_type, width, height me duration, mō ngā pikitia, ataata me te oro. Ko output te ahanoa hua ake o te tauira.
Ngā āpure o te putanga
combined_mask
object {url, content_type, file_name, file_size, width, height}Kanohi huna wehewehenga e hanumi ana i ngā putanga.
individual_masks
array of object {url, content_type, file_name, file_size, width, height}Ngā kanohi huna motuhake mō ngā wāhanga takitahi.

Ētahi atu tauira: Whakatika Atahanga

Mō ngā āpiha AI: kei te wātea tēnei whārangi hei Markdown ki https://doitong.com/mi/developers/models/sam2/auto-segment.md. Ngā tauira me ngā aratohu katoa: https://doitong.com/developers/llms.txt