For the complete documentation index, see llms.txt. This page is also available as Markdown.

バッチ処理

クラウド基盤を用意して、大量の画像や保存済み動画に対して Workflows を実行します。

概要

Batch Processing は、画像バッチや保存済み動画に対して実行するコスト効率の高い方法です。 Workflows 画像バッチや保存済み動画に対して実行できます。大量のデータを非同期で処理するのに最適です。

Batch Processing は、大規模なバッチを実行するために必要なインフラを自動的にプロビジョニングします。

Batch Processing は Growth および Enterprise プランで利用できます。ジョブは「Batch Processing」タブから開始するか、Asset Library 内の選択項目に対して Workflow を実行できます。 Asset Library.

Roboflow の Web インターフェース、または API(CLI 経由)から Batch Processing ジョブを設定できます。

ジョブを開始すると、データを処理するためのマシンがクラウド上にプロビジョニングされます。その後、データに対して実行した Workflow の出力が入った JSON ファイルを受け取ります。

次の動画では、Batch Processing を詳しく説明しています:

Web アプリ

Batch Processing ジョブを作成する

Batch Processing ジョブを作成するには、Roboflow ダッシュボードの左サイドバーで Deployments をクリックします。次に、「Batch Processing」タブをクリックします:

「New Batch Job」をクリックして Batch Processing ジョブを作成します。

ジョブを設定するウィンドウが開きます:

Workflow を選択

ジョブの設定を始めるには、まず Workflow を選択します。まだ Workflow がない場合は、Getting started のために Workflows のドキュメントを参照してください。

画像または動画をアップロード

次に、Workflow を実行したい画像または動画をアップロードする必要があります。

ハードウェアを設定

Batch Processing ジョブは CPU または GPU で実行できます。GPU ジョブは高速ですが、より高価です。

料金情報については、Roboflow の料金ドキュメントを参照してください。

ジョブには CPU または GPU のいずれかを選択してください:

「Advanced Options」タブには、いくつかの高度な設定オプションもあります。これらのオプションはデフォルトのままにしておくことを推奨します。

ジョブを開始

Batch Processing ジョブを開始するには、「Create Batch Job」をクリックします。

ジョブのインフラがプロビジョニングされ、処理が開始されます。

ジョブの進行状況を監視

ジョブを開始すると、処理の設定中、バッチデータの処理中、そしてジョブ完了時に状態インジケーターが表示されます。

バッチのどこまでが処理済みかをリアルタイムで監視できます。

データの処理にかかる時間は、処理する画像や動画の数、Workflow の複雑さ、選択した CPU または GPU ハードウェアによって異なります。

ジョブを開くと、ジョブがどの画像で実行されたかを示す「Input Source」を含む詳細を確認できます: Asset Library それらを選択するために使われた検索クエリ(その選択を再度開くためのリンク付き)、または手動で選択された画像数。

アプリから Workflow を実行

に加えて、 API および CLI、Roboflow アプリから直接 Batch Processing ジョブを開始して、 ワークフロー 保存済み画像の大規模セットに対して Workflow を実行できます。方法は 2 つあります:

  • Asset Library からオンデマンドで。

  • Datasource がクラウドバケットから新しい画像をミラーリングするたびに自動で。

Asset Library から

次の Asset Library では、選択した画像に対して、オンデマンドで Workflow を実行できます。

画像を手動で選択するか、現在の検索条件に一致するすべての画像を選択してから、「Run Workflow」をクリックします。結果を画像に書き戻す方法を含む全体のフローについては、 Workflow の実行.

Datasource がミラーリングすると自動的に

1つの Datasource クラウドバケットから Workspace に画像とメタデータをミラーリングします。各ミラーリングで取り込まれた新しい画像に対して、自動で Workflow を実行できます。これにより、タグ付け、品質スコアリング、事前ラベリングなどのエンリッチメントを、新しいデータが到着するたびに手動操作なしで最新の状態に保てます。

これらの自動化は、 Datasources ページの「Workflow runs」セクションで設定します。

Workflow runs の管理には、バッチ自動化を管理する権限を持つ Workspace ロールが必要です。「Workflow runs」セクションが表示されない場合は、Workspace 管理者に依頼してください。

自動化を追加するには:

  1. 「Workflow runs」セクションで、「Add workflow run」をクリックします。

  2. 自動化の名前を入力します。

  3. 「Run when」で「On Sync」を選び、 Datasources を選択してトリガーされるようにします。

  4. 実行する Workflow を選択します。これはちょうど 1 つの image 入力を持っている必要があります。

  5. マシンタイプ(CPU または GPU)を選択します。

  6. 「Create」をクリックします。

選択した Datasource のいずれかがミラーリングされるたびに、そのミラーで取り込まれた画像に対して Workflow が Batch Processing ジョブとして実行されます。進行状況は Activity Center と Deployments の「Batch Processing」タブで、他の Batch Processing ジョブと同様に追跡できます。

Workflow の結果を画像に書き戻して Asset Library で検索できるようにする方法については、 結果を書き戻す.

API または CLI からジョブを実行

プログラムで Batch Processing ジョブを作成して実行するには、以下の HTTP API および CLI セクションを参照してください。よくある問題のデバッグについては、 トラブルシューティング.

HTTP API

クイックリンク:

データを取り込む

動画をアップロード

Upload a video

post

Request a signed URL to upload a video file. After receiving the response, PUT the video to the uploadURL with the provided extensionHeaders.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

Batch identifier. Lowercase, max 64 chars: letters, digits, hyphens, underscores.

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
api_keystring必須

Your Roboflow API key.

fileNamestring必須

Name of the video file (e.g. my_video.mp4).

レスポンス
200

Signed URL details for uploading the video.

application/json
statusstringオプションExample: ok
post/data-staging/v1/external/{workspace}/batches/{batch_id}/upload/video
POST /data-staging/v1/external/{workspace}/batches/{batch_id}/upload/video?api_key=text&fileName=text HTTP/1.1
Host: api.roboflow.com
Accept: */*
200

Signed URL details for uploading the video.

{
  "status": "ok",
  "signedURLDetails": {
    "uploadURL": "text",
    "method": "PUT",
    "extensionHeaders": {
      "Content-Type": "application/octet-stream",
      "x-goog-content-length-range": "1,1073741824"
    },
    "maxFileSize": 1073741824
  }
}

画像をアップロード

Upload a single image

post

Upload a single image via multipart form data. Best for batches up to 5,000 images.

Note: Single-image and bulk uploads cannot be combined for the same batch.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

Batch identifier. Lowercase, max 64 chars: letters, digits, hyphens, underscores.

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
api_keystring必須

Your Roboflow API key.

fileNamestring必須

Name of the image file.

本文
filestring · binaryオプション

The image file to upload.

レスポンス
200

Image uploaded successfully.

application/json
statusstringオプションExample: ok
post/data-staging/v1/external/{workspace}/batches/{batch_id}/upload/image
POST /data-staging/v1/external/{workspace}/batches/{batch_id}/upload/image?api_key=text&fileName=text HTTP/1.1
Host: api.roboflow.com
Content-Type: multipart/form-data
Accept: */*
Content-Length: 17

{
  "file": "binary"
}
200

Image uploaded successfully.

{
  "status": "ok"
}

画像を一括アップロード

Bulk upload images

post

Request a signed URL for uploading a .tar archive of images. Recommended for batches exceeding 5,000 images. Bundle up to 500 images per archive.

The response contains a signed URL and extension headers. Pack images into a .tar archive and PUT it to the signed URL.

Note: Bulk and single-image uploads cannot be combined for the same batch.

When performing bulk ingestion, data is indexed in the background. There may be a short delay before all data is available.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

Batch identifier. Lowercase, max 64 chars: letters, digits, hyphens, underscores.

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
api_keystring必須

Your Roboflow API key.

レスポンス
200

Signed URL details for uploading a tar archive.

application/json
statusstringオプションExample: ok
post/data-staging/v1/external/{workspace}/batches/{batch_id}/bulk-upload/image-files
POST /data-staging/v1/external/{workspace}/batches/{batch_id}/bulk-upload/image-files?api_key=text HTTP/1.1
Host: api.roboflow.com
Accept: */*
200

Signed URL details for uploading a tar archive.

{
  "status": "ok",
  "signedURLDetails": {
    "shardId": "123e4567-e89b-12d3-a456-426614174000",
    "uploadURL": "text",
    "method": "PUT",
    "extensionHeaders": {
      "Content-Type": "application/x-tar",
      "x-goog-content-length-range": "1,536870912"
    },
    "maxNumberOfImages": 500,
    "maxShardSize": 536870912
  }
}

バッチのステータスを確認

Get batch item count

get

Returns the count of ingested items in a batch. Use this to verify all data has been ingested before starting a job.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

Batch identifier. Lowercase, max 64 chars: letters, digits, hyphens, underscores.

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
api_keystring必須

Your Roboflow API key.

レスポンス
200

Batch item count.

application/json
statusstringオプションExample: ok
countintegerオプション

Number of items in the batch.

Example: 42
get/data-staging/v1/external/{workspace}/batches/{batch_id}/count
GET /data-staging/v1/external/{workspace}/batches/{batch_id}/count?api_key=text HTTP/1.1
Host: api.roboflow.com
Accept: */*
200

Batch item count.

{
  "status": "ok",
  "count": 42
}

シャードのアップロード詳細を確認

List batch shards

get

Returns shard details for a bulk-upload batch. Paginated — use nextPageToken from the response to fetch subsequent pages.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

Batch identifier. Lowercase, max 64 chars: letters, digits, hyphens, underscores.

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
api_keystring必須

Your Roboflow API key.

nextPageTokenstringオプション

Pagination token from a previous response.

レスポンス
200

Paginated list of batch shards.

application/json
statusstringオプションExample: ok
shardsobject[]オプション

List of shard objects.

nextPageTokenstring · ヌル許容オプション

Token for fetching the next page of results. null if no more pages.

get/data-staging/v1/external/{workspace}/batches/{batch_id}/shards
GET /data-staging/v1/external/{workspace}/batches/{batch_id}/shards?api_key=text HTTP/1.1
Host: api.roboflow.com
Accept: */*
200

Paginated list of batch shards.

{
  "status": "ok",
  "shards": [
    {}
  ],
  "nextPageToken": "text"
}

ジョブを開始

Start a batch processing job

post

Start a batch processing job that runs a Workflow against staged data.

Job ID constraints: Lowercase letters, digits, hyphens, and underscores only. Maximum 20 characters.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

job_idstring · 最大: 20必須

Job identifier. Lowercase, max 20 chars: letters, digits, hyphens, underscores.

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
api_keystring必須

Your Roboflow API key.

本文
typestring · enum必須

Job type.

可能な値:
processingTimeoutSecondsintegerオプション

Maximum cumulative machine runtime in seconds across all parallel workers.

Default: 3600
notificationsURLstring · uriオプション

Webhook URL for job completion notifications. Custom webhook headers are not yet supported. The only header sent is Authorization: Bearer rf_{workspace_id}.

レスポンス
200

Job started successfully.

application/json
statusstringオプションExample: ok
post/batch-processing/v1/external/{workspace}/jobs/{job_id}
POST /batch-processing/v1/external/{workspace}/jobs/{job_id}?api_key=text HTTP/1.1
Host: api.roboflow.com
Content-Type: application/json
Accept: */*
Content-Length: 415

{
  "type": "simple-image-processing-v1",
  "jobInput": {
    "type": "staging-batch-input-v1",
    "batchId": "text"
  },
  "computeConfiguration": {
    "type": "compute-configuration-v2",
    "machineType": "cpu",
    "workersPerMachine": 4
  },
  "processingTimeoutSeconds": 3600,
  "processingSpecification": {
    "type": "workflows-processing-specification-v1",
    "workspace": "text",
    "workflowId": "text",
    "aggregationFormat": "jsonl"
  },
  "notificationsURL": "https://example.com"
}
200

Job started successfully.

{
  "status": "ok"
}

ジョブの進行状況を監視

ジョブのステータスを取得

Get job status

get

Returns the current status of a batch processing job.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

job_idstring · 最大: 20必須

Job identifier. Lowercase, max 20 chars: letters, digits, hyphens, underscores.

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
api_keystring必須

Your Roboflow API key.

レスポンス
200

Job status details.

application/json
statusstringオプションExample: ok
jobStatusstringオプション

Current job status (e.g. pending, processing, completed, failed).

progressnumberオプション

Processing progress as a fraction between 0 and 1.

get/batch-processing/v1/external/{workspace}/jobs/{job_id}
GET /batch-processing/v1/external/{workspace}/jobs/{job_id}?api_key=text HTTP/1.1
Host: api.roboflow.com
Accept: */*
200

Job status details.

{
  "status": "ok",
  "jobStatus": "text",
  "progress": 1
}

ジョブステージを一覧表示

List job stages

get

Returns the list of stages for a job. Each job typically has processing and export stages, each producing an output batch.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

job_idstring · 最大: 20必須

Job identifier. Lowercase, max 20 chars: letters, digits, hyphens, underscores.

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
api_keystring必須

Your Roboflow API key.

レスポンス
200

List of job stages.

application/json
statusstringオプションExample: ok
stagesobject[]オプション

List of stage objects. Each stage has an ID and an output batch ID.

get/batch-processing/v1/external/{workspace}/jobs/{job_id}/stages
GET /batch-processing/v1/external/{workspace}/jobs/{job_id}/stages?api_key=text HTTP/1.1
Host: api.roboflow.com
Accept: */*
200

List of job stages.

{
  "status": "ok",
  "stages": [
    {}
  ]
}

ステージタスクを一覧表示

List tasks for a stage

get

Returns the list of tasks for a specific job stage. Paginated — use nextPageToken from the response to fetch subsequent pages.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

job_idstring · 最大: 20必須

Job identifier. Lowercase, max 20 chars: letters, digits, hyphens, underscores.

Pattern: ^[a-z0-9_-]+$
stage_idstring必須

The stage identifier.

クエリパラメータ
api_keystring必須

Your Roboflow API key.

nextPageTokenstringオプション

Pagination token from a previous response.

レスポンス
200

Paginated list of tasks.

application/json
statusstringオプションExample: ok
tasksobject[]オプション

List of task objects.

nextPageTokenstring · ヌル許容オプション

Token for fetching the next page of results. null if no more pages.

get/batch-processing/v1/external/{workspace}/jobs/{job_id}/stages/{stage_id}/tasks
GET /batch-processing/v1/external/{workspace}/jobs/{job_id}/stages/{stage_id}/tasks?api_key=text HTTP/1.1
Host: api.roboflow.com
Accept: */*
200

Paginated list of tasks.

{
  "status": "ok",
  "tasks": [
    {}
  ],
  "nextPageToken": "text"
}

結果をエクスポート

出力パートを一覧表示

List output batch parts

get

Lists the parts of an output batch. Use the export stage output batch for compressed results.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

Batch identifier. Lowercase, max 64 chars: letters, digits, hyphens, underscores.

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
api_keystring必須

Your Roboflow API key.

レスポンス
200

List of batch parts.

application/json
statusstringオプションExample: ok
get/data-staging/v1/external/{workspace}/batches/{batch_id}/parts
GET /data-staging/v1/external/{workspace}/batches/{batch_id}/parts?api_key=text HTTP/1.1
Host: api.roboflow.com
Accept: */*
200

List of batch parts.

{
  "status": "ok",
  "parts": [
    {
      "partName": "text"
    }
  ]
}

ダウンロード URL を一覧表示

List download URLs

get

Returns paginated download URLs for files in a batch part.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

Batch identifier. Lowercase, max 64 chars: letters, digits, hyphens, underscores.

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
api_keystring必須

Your Roboflow API key.

nextPageTokenstringオプション

Pagination token from a previous response.

partNamestringオプション

Filter by part name (from the list parts response).

レスポンス
200

Paginated list of download URLs.

application/json
statusstringオプションExample: ok
nextPageTokenstring · ヌル許容オプション

Token for fetching the next page of results. null if no more pages.

get/data-staging/v1/external/{workspace}/batches/{batch_id}/list
GET /data-staging/v1/external/{workspace}/batches/{batch_id}/list?api_key=text HTTP/1.1
Host: api.roboflow.com
Accept: */*
200

Paginated list of download URLs.

{
  "status": "ok",
  "filesMetadata": [
    {
      "downloadURL": "text",
      "fileName": "text",
      "partName": "text",
      "shardId": "text",
      "contentType": "text",
      "nestedContentType": "text"
    }
  ],
  "nextPageToken": "text"
}

Webhook 通知

ステータスをポーリングする代わりに、Webhook を使って取り込みまたは処理完了時に通知を受け取れます。 CLI の使用方法 Webhook の設定とペイロード形式については、

CLI

をインストールすると inference-cli にアクセスできるようになり、 inference rf-cloud コマンドを使用できます。これにより、Roboflow Batch Processing のコアコンポーネントである Batch Processing と Data Staging を操作できます。

セットアップ

クラウドストレージのサポートが必要な場合:

API キーの見つけ方については、 認証ガイド.

データを取り込む

画像

動画

Batch ID の形式: 小文字のみで、64 文字以下。使用できるのは英字、数字、ハイフン(-)、およびアンダースコア(_).

クラウドストレージ

データがすでにクラウドストレージ(S3、Google Cloud Storage、Azure)にある場合、ファイルをローカルにダウンロードせずに直接処理できます。

画像の場合:

動画の場合:

次の --bucket-path パラメータは以下のプロバイダーをサポートしています。Glob パターンで取り込むファイルを絞り込みます:

プロバイダー
パス形式
Glob の例

S3

s3://bucket-name/path/

s3://my-bucket/training-data/**/*.jpg - すべての JPG を再帰的に

Google Cloud Storage

gs://bucket-name/path/

gs://my-bucket/videos/2024-*/*.mp4 - 以内の MP4 2024-* フォルダー

Azure Blob Storage

az://container-name/path/

az://container/images/*.png - images フォルダー内の PNG

クラウドストレージの認証情報は ローカルでのみ CLI によって署名付き URL を生成するために使用されます。これらは アップロードされることは決してありません Roboflow サーバーに。

大規模データセットの場合、システムは自動的に画像を 20,000 ファイルごとのチャンクに分割します。動画は 1,000 未満のバッチで最も効果的です。

署名付き URL による取り込み

高度な自動化では、ローカルファイルではなく署名付き URL 経由でデータを取り込めます:

フラグ
説明

--data-source references-file

署名付き URL 経由で参照されたファイルを処理します。

--references <path_or_url>

ファイル URL を含む JSONL ファイルへのパス、またはそのようなファイルを指す署名付き URL。

参照ファイル形式(JSONL):

署名付き URL による取り込みは、Growth Plan および Enterprise のお客様にご利用いただけます。

ステージ済みデータを確認

ジョブを開始

画像を処理

動画を処理

Workflow ID の見つけ方: Roboflow アプリで Workflow Editor を開き、「Deploy」をクリックし、コードスニペット内の識別子を見つけます。

デフォルトでは、処理は CPU 上で実行されます。 --machine-type gpu を複数のモデルや大規模モデルを含む Workflow に使用します。

ジョブの進行状況を監視

開始コマンドは ジョブ IDを出力します。ステータス確認に使用します:

結果をエクスポート

ジョブの詳細には 出力バッチ IDが含まれます。結果のエクスポートに使用します:

Webhook 自動化

ステータスをポーリングする代わりに、Webhook を使って取り込みまたは処理完了時に通知を受け取れます。

データ取り込み Webhook

CLI コマンド create-batch-of-images および create-batch-of-videos は以下をサポートします:

フラグ
説明

--notifications-url <webhook_url>

通知用の Webhook エンドポイント。

--notification-category ingest-status

取り込みプロセス全体のステータス。デフォルト。

--notification-category files-status

各ファイルの処理ステータス。

通知は HTTP POST で送信され、 Authorization ヘッダーには Roboflow の Publishable Key が含まれます。

取り込みステータス通知

ファイルステータス通知

ジョブ完了 Webhook

追加する --notifications-url をジョブ開始時に指定します:

ジョブ完了通知

クラウドストレージ認証

AWS S3 と S3 互換ストレージ

認証情報は以下から自動的に検出されます:

  1. 環境変数:

  1. AWS 認証情報ファイル (~/.aws/credentials, ~/.aws/config)

  2. IAM ロール (EC2、ECS、Lambda)

名前付きプロファイル:

S3 互換サービス(Cloudflare R2、MinIO など):

Google Cloud Storage

認証情報は以下から検出されます:

  1. サービスアカウント キーファイル (自動化に推奨):

  1. ユーザー認証情報 gcloud CLI から(gcloud auth login)

  2. GCP メタデータサービス (Google Cloud Platform 上で実行している場合)

Azure Blob Storage

SAS トークン(推奨):

アカウントキー:

Azure CLI で SAS トークンを生成します:

カスタムスクリプト

高度なユースケースでは、署名付き URL ファイルを生成するためのスクリプトを参照してください:

すべてのオプションを確認

最終更新

役に立ちましたか?