কনটেন্টে যান

Segment Anything Model 2 · Auto Segment

ইন্টিগ্রেট করুন

মডেল 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"

এই অনুরোধ: ≈০.০১৪$ ১৪ API ক্রেডিট এই পেজে চালান

API কী পান
Meta ছবি সম্পাদনা #segmentation#mask

স্বয়ংক্রিয় সম্পূর্ণ-ইমেজ সেগমেন্টেশন, যা পৃথক মাস্ক এবং একটি সম্মিলিত মাস্ক ফেরত দেয়

Meta · ডেটা (JSON)

আপনার প্রথম ফলাফল এখানে আসবে

নিচে একটি রিকোয়েস্ট তৈরি করে আপনার API কী দিয়ে চালান। আউটপুট আমাদের স্টোরেজে কপি করা হয়, চিরকাল বা বিনামূল্যে ৭ দিন পর্যন্ত রাখা হয়।

একটি অনুরোধ তৈরি করুন

মডেল স্কিমা থেকে কন্ট্রোল তৈরি করা হয়। এগুলো পরিবর্তন করলে কোড ও মূল্য আপডেট হয়।

•আবশ্যক image_url
একটি ফাইল ড্রপ করুন, অথবা

automatic segmentation-এর জন্য ছবির URL।

অ্যাডভান্সড output_format · points_per_side · pred_iou_thresh · stability_score_thresh · min_mask_region_area
output_format ডিফল্ট png

ফলাফল ছবির ফাইল ফরম্যাট।

ডিফল্ট 32

ছবির প্রতিটি পাশ বরাবর sample point-এর সংখ্যা।

ডিফল্ট 0.88

predicted IOU score-এ প্রয়োগ করা cutoff।

ডিফল্ট 0.95

stability score-এ প্রয়োগ করা cutoff।

ডিফল্ট 100

অনুমোদিত mask region-এর সর্বনিম্ন area।

POST /run/sam2/auto-segment?wait=20 মূল্য → ০.০১৪$
# 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"

এই অনুরোধ চালান

আপনার key এই ব্রাউজারেই থাকে: এটি শুধু Doitong API-তে পাঠানো হয় এবং Remember টিক দিলে কেবল localStorage-এ সংরক্ষিত হয়। একটি API কী পান

Segment Anything Model 2 · Auto Segment সম্পর্কে

`image_url`-এ কোনো প্রম্পট ছাড়াই একটি ছবি সেগমেন্ট করে, একটি সম্মিলিত মাস্ক এবং পৃথক মাস্কগুলোর একটি অ্যারে ফেরত দেয়। `points_per_side` (ডিফল্ট 32), `pred_iou_thresh`, `stability_score_thresh` এবং `min_mask_region_area` দিয়ে শনাক্তকরণ সামঞ্জস্য করুন। মাস্কের ছবি png বা jpeg হিসেবে সংরক্ষণ করা যায়।

প্যারামিটার

ক্যানোনিকাল নাম অথবা নেটিভ নাম—দুটো একসঙ্গে নয়—পাঠান। ক্যানোনিকাল নামগুলো

নামধরন ডিফল্টঅনুমোদিত বিবরণ
image_urlআবশ্যক image
ধরনurl · image
automatic segmentation-এর জন্য ছবির URL।
output_formatঐচ্ছিক
ধরনenum
ডিফল্টpng
jpegpng
ফলাফল ছবির ফাইল ফরম্যাট।
points_per_sideঐচ্ছিক
ধরনinteger
ডিফল্ট32
ছবির প্রতিটি পাশ বরাবর sample point-এর সংখ্যা।
pred_iou_threshঐচ্ছিক
ধরনnumber
ডিফল্ট0.88
predicted IOU score-এ প্রয়োগ করা cutoff।
stability_score_threshঐচ্ছিক
ধরনnumber
ডিফল্ট0.95
stability score-এ প্রয়োগ করা cutoff।
min_mask_region_areaঐচ্ছিক
ধরনinteger
ডিফল্ট100
অনুমোদিত mask region-এর সর্বনিম্ন area।
আবশ্যক ক্যানোনিকাল নাম, এটিও গ্রহণযোগ্য

ফাইল প্যারামিটার হিসেবে একটি পাবলিক https:// URL, 10 MB পর্যন্ত একটি data: URI, অথবা আপলোডের file_url গ্রহণ করা হয়। ফাইল

আউটপুট

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"
  }
}
আপনার ফাইল, আপনার পছন্দপ্রতিটি outputs[].url আমাদের স্টোরেজে একটি কপি: চিরকাল রাখা হয় (প্রতি GB-মাস অনুযায়ী অর্থপ্রদত্ত) অথবা অ্যাকাউন্ট সেটিংস বা ?storage= অনুযায়ী বিনামূল্যে ৭ দিন পর্যন্ত।
প্রতিটি মডেলে একই গঠনছবি, ভিডিও এবং অডিও—সব ক্ষেত্রেই type, url, content_type, width, height এবং duration। output হলো মডেলের নিজস্ব ফলাফল অবজেক্ট।
আউটপুটের ফিল্ড
combined_mask
object {url, content_type, file_name, file_size, width, height}ফলাফলগুলো একত্র করা segmentation mask।
individual_masks
array of object {url, content_type, file_name, file_size, width, height}পৃথক segment-এর জন্য আলাদা mask।

আরও মডেল: ছবি সম্পাদনা

AI এজেন্টদের জন্য: এই পৃষ্ঠাটি Markdown হিসেবে এখানে আছে https://doitong.com/bn/developers/models/sam2/auto-segment.md. সব মডেল ও গাইড: https://doitong.com/developers/llms.txt