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

バッチ処理

クラウドインフラを用いて、大量の画像や保存済み動画に対して Workflow を実行します。

概要

バッチ処理は、実行するための費用対効果の高い方法です ワークフロー 画像のバッチや保存済み動画に対して行えます。大量のデータを非同期で処理するのに最適です。

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

バッチ処理は、RoboflowのクレジットシステムまたはEnterpriseプランのすべてのワークスペースで利用できます。「Batch Processing」タブからジョブを開始するか、 アセットライブラリ.

バッチ処理ジョブは、RoboflowのWebインターフェースまたはAPI(CLI経由)で設定できます。

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

ジョブはCPUまたはGPUマシンで実行されます。GPUジョブは高速ですが、費用が高くなります。参照: Roboflowの料金. ジョブにかかる時間は、処理する画像や動画の数、ワークフローの複雑さ、マシンの種類によって異なります。一般的な問題については、参照: トラブルシューティング.

次の動画ではバッチ処理を詳しく説明しています:

Webアプリ

左側のサイドバーで「Deployments」を開き、「Batch Processing」タブを選択します。

「New Batch Job」をクリックし、次の手順に従います:

  1. 処理する画像または動画をアップロードします。

  2. CPUまたはGPUのハードウェアを選択します。変更が必要な場合を除き、「Advanced Options」はデフォルトのままにしてください。

  3. 「Create Batch Job」をクリックします。

ジョブ一覧には各ジョブの進捗がリアルタイムで表示されます。このタブから開始したジョブはActivity Centerにも表示され、そこではあなただけが見ることができます。ジョブをクリックすると詳細が開きます。「Source and type」には、どの画像で実行されたかが表示されます: アセットライブラリ それらを選択した検索クエリ、「Open in Asset Library」リンク、または手動で選択した画像数です。

アセットライブラリから

の中で アセットライブラリ、画像を選択するか、検索条件に一致するすべての画像を選択してから、「Run Workflow」をクリックします。参照: ワークフローの実行 結果を画像に書き戻す方法を含む全体の流れについて。

エージェントから

指示する Roboflow Agent に、公開済みワークフローをアセットライブラリの画像に対して実行させます。選択した画像、検索条件に一致する画像、またはライブラリ全体を対象にできます。ジョブの状況を報告することもでき、ジョブが完了するとチャットで通知します。開始したジョブはBackground Tasksにも表示されます。

Agentは、Batch Processingをチャットタブとして開くこともできます。新しいジョブフォームでは、Agentが同意したワークフローと設定を入力しますが、ファイルの選択はご自身のコンピュータから行います。

Datasourceがミラーリングされるたびに自動で

たびに毎回 データソース ミラーリングされると、バッチ処理ジョブは取り込んだ新しい画像に対してワークフローを実行できます(例: タグや事前ラベルを最新に保つため)。「Workflow runs」セクションの データソース ページで「Add workflow run」をクリックします。「Run when」で「On Sync」を選択し、トリガーとなるデータソースを選択します。ワークフローにはちょうど1つの 画像 入力が必要です。

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

結果を検索可能にするには、参照: 結果をアセットライブラリに書き戻す.

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.

認可
api_keystring必須

Your Roboflow API key.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

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

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
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?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.

認可
api_keystring必須

Your Roboflow API key.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

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

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
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?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.

認可
api_keystring必須

Your Roboflow API key.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

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

Pattern: ^[a-z0-9_-]+$
レスポンス
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 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.

認可
api_keystring必須

Your Roboflow API key.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

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

Pattern: ^[a-z0-9_-]+$
レスポンス
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 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.

認可
api_keystring必須

Your Roboflow API key.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

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

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
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 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.

認可
api_keystring必須

Your Roboflow API key.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

job_idstring · 最大: 20必須

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

Pattern: ^[a-z0-9_-]+$
本文
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} 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.

認可
api_keystring必須

Your Roboflow API key.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

job_idstring · 最大: 20必須

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

Pattern: ^[a-z0-9_-]+$
レスポンス
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} 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.

認可
api_keystring必須

Your Roboflow API key.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

job_idstring · 最大: 20必須

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

Pattern: ^[a-z0-9_-]+$
レスポンス
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 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.

認可
api_keystring必須

Your Roboflow API key.

パスパラメータ
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.

クエリパラメータ
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 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.

認可
api_keystring必須

Your Roboflow API key.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

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

Pattern: ^[a-z0-9_-]+$
レスポンス
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 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.

認可
api_keystring必須

Your Roboflow API key.

パスパラメータ
workspacestring必須

Your Roboflow workspace identifier.

batch_idstring · 最大: 64必須

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

Pattern: ^[a-z0-9_-]+$
クエリパラメータ
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 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 rf-cloud すでにあなたの アセットライブラリ、使用するには roboflow batch.

ローカルおよびクラウドファイル

セットアップ

ローカルまたはクラウドのファイルについては、Inference CLIをインストールします:

クラウドストレージのサポートについては:

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

データを取り込む

画像

動画

最大64文字までの小文字のバッチIDを使用してください: 文字、数字、ハイフン(-)、およびアンダースコア(_).

クラウドストレージ

データがすでにクラウドストレージ(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

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

大規模なデータセットでは、システムが画像を自動的に20,000ファイルずつのチャンクに分割します。動画は1,000件未満のバッチで最適に動作します。

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

高度な自動化では、ローカルファイルの代わりに署名付きURL経由でデータを取り込むことができます:

フラグ
説明

--data-source references-file

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

--references <path_or_url>

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

参照ファイルは JSONL:

署名付きURLによる取り込みは、Enterpriseプランおよび旧Growthプランで利用できます。

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

ジョブを開始

画像を処理

動画を処理

ワークフローIDを見つけるには、Roboflow AppでWorkflow Editorを開き、「Deploy」をクリックし、コードスニペット内の識別子を確認します。

デフォルトでは、処理はCPUで実行されます。 --machine-type gpu 複数のモデルや大きなモデルを使うワークフローには、これを使用します。

ジョブの進捗を監視

開始コマンドはジョブ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

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

通知は、 Authorization ヘッダーにRoboflowの公開キーを含めたHTTP POSTで送信されます。

取り込みステータス通知

ファイルステータス通知

ジョブ完了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トークンを生成します。 <expiry-utc> を、将来のUTC時刻の YYYY-MM-DDTHH:MMZ 形式で置き換えます:

カスタムスクリプト

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

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

アセットライブラリの画像

置き換える <workspace-url> をワークスペースのスラッグ(例: my-workspace)に置き換えます。1つの 画像 入力を持つ公開済みワークフローを選択します。 source_idを除き、必要な他の入力にはデフォルト値を設定してください。Batch Processingが各画像ごとに入力します。

Roboflow CLIをインストールまたは更新し、 Roboflow CLIサインインして、ワークフローを一覧表示します:

公開済みワークフローの id をJSON出力から使用します。RoboQL検索で処理対象の画像を見つけます: RoboQL 検索:

検索結果の画像IDを --image-ids:

構造化フィルタに一致するすべての画像を処理するには、 --image-ids を --query "tag:night-shift"に置き換えます。 --all を使用して、アセットライブラリ全体を処理します。選択オプションは1つだけ選んでください。

作成レスポンスには taskId, jobId、 requestIdが含まれます。task ID を使って完了を待ち、job ID を使ってジョブを確認します:

ターミナルを閉じても、または wait コマンドがタイムアウトしても、ジョブは実行を続けます。ネットワークエラーの後は、同じオプションで再試行してください。次を指定します requestId レスポンスまたはエラーのヒントから、次のように --request-id <request-id> 重複ジョブの作成を避けるためです。

使用する batch abort <job-id> ジョブを停止するには、または batch restart <job-id> 既存の設定で再試行します。どちらのコマンドも確認を求めます。次を追加してください --yes スクリプトでは使用します。再起動によりクレジットが消費される場合があります。

最終更新

役に立ちましたか?