コンテンツへスキップ

Segment Anything Model 2 · Video

統合

モデルID sam2/video
# 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/video?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4"
  }'

# 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"

1 回の実行につき最大 $4.00 実際の使用量に応じて課金され、残額は返金されます このページで実行

APIキーを取得
Meta 動画変換 #segmentation#mask#real-time

点またはボックスのプロンプトから、動画内のオブジェクトをセグメント化して追跡します。開始マスクも任意で指定できます

Meta · 動画

最初の結果がここに表示されます

以下でリクエストを作成し、APIキーで実行してください。出力はストレージにコピーされ、永久保存または無料で7日保存されます。

リクエストを作成

コントロールはモデルスキーマから生成されます。値を変更するとコードと価格が更新されます。

•必須 video_url
ファイルをドロップ、または

セグメンテーション用の動画URL。

詳細設定 mask · apply_mask · boundingbox_zip · prompts · box_prompts
mask_url
ファイルをドロップ、または

初回適用に使用するマスクURL。

デフォルト []

動画セグメンテーションに使用するプロンプト。

デフォルト []

ボックス境界の座標。

POST /run/sam2/video?wait=20 見積もり → $4.00
# 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/video?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "video": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4"
  }'

# 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"

このリクエストを実行

キーはこのブラウザ内に保持されます。Doitong APIにのみ送信され、「記憶する」にチェックを入れた場合のみlocalStorageに保存されます。 APIキーを取得

Segment Anything Model 2 · Videoについて

SAM 2 で動画をセグメント化します。`prompts` または `box_prompts` でガイドするか、`mask_url` で初期マスクを指定します。`apply_mask` を有効にすると、出力動画にマスクを重ねます。`boundingbox_zip` を有効にすると、フレームごとのバウンディングボックスのオーバーレイも zip アーカイブで受け取れます。

パラメータ

正式名称またはネイティブ名のいずれか一方を送信してください。両方は送信しないでください。 正式名称

名前型 デフォルト許可される値 説明
video_url必須 video
型url · video
セグメンテーション用の動画URL。
mask_url任意 mask
型url · image
初回適用に使用するマスクURL。
prompts任意
型object[]
デフォルト[]
動画セグメンテーションに使用するプロンプト。
prompts[].x任意
型integer
デフォルト305
X軸上のプロンプト位置。
prompts[].y任意
型integer
デフォルト350
Y軸上のプロンプト位置。
prompts[].label任意
型enum
デフォルト1
01
プロンプトラベル。1は前景、0は背景を示します。
prompts[].frame_index任意
型integer
デフォルト0
インタラクション対象のフレームを識別するインデックス。
box_prompts任意
型object[]
デフォルト[]
ボックス境界の座標。
box_prompts[].x_min任意
型integer
デフォルト0
ボックスの最小 x 座標。
box_prompts[].y_min任意
型integer
デフォルト0
ボックスの最小 y 座標。
box_prompts[].x_max任意
型integer
デフォルト0
プロンプトの最大 x 座標。
box_prompts[].y_max任意
型integer
デフォルト0
プロンプトの最大 y 座標。
box_prompts[].frame_index任意
型integer
デフォルト0
インタラクション対象のフレームを識別するインデックス。
apply_mask任意
型boolean
デフォルトfalse
動画にマスキングを適用するかどうか。
boundingbox_zip任意
型boolean
デフォルトfalse
各フレームのバウンディングボックスオーバーレイを含むZIPアーカイブも返すかどうか。
必須 正式名称(こちらも使用可能)

ファイルパラメータには、公開されたhttps:// URL、10 MBまでのdata: URI、またはアップロードしたファイルのfile_urlを指定します。 ファイル

出力

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "sam2/video",
  "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": 4000,
    "usd": "4.00",
    "charged": 4000,
    "refunded": 0
  },
  "input": {
    "video_url": "https://content.doitong.com/video/showcase/v3/gen_fox_cartoon.mp4"
  },
  "output": {
    "video": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_name": "0-output.mp4",
      "file_size": 1843200
    },
    "boundingbox_frames_zip": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_name": "0-output.mp4",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "video",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_size": 1843200,
      "width": 1280,
      "height": 720,
      "duration": 5,
      "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はストレージ上のコピーです。アカウント設定または?storage=により、永久保存(GB・月単位で有料)または無料で7日保存できます。
すべてのモデルで同じ形式画像、動画、音声のいずれでも、type、url、content_type、width、height、durationが含まれます。outputはモデル独自の結果オブジェクトです。
出力フィールド
video
object {url, content_type, file_name, file_size}セグメンテーションで生成された動画。
boundingbox_frames_zip
object {url, content_type, file_name, file_size} | null各フレームのバウンディングボックスオーバーレイを含むZIPアーカイブ。

その他のモデル: 動画変換

AIエージェント向け:このページのMarkdown版はこちらです: https://doitong.com/ja/developers/models/sam2/video.md. すべてのモデルとガイド: https://doitong.com/developers/llms.txt