コンテンツへスキップ
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Vision Event 画像をアップロード

ワークスペースレベルの画像をアップロードし、Vision Event を作成するときにその sourceId を参照します。

概要

このエンドポイントは、 ビジョンイベントで使用する画像をワークスペースにアップロードします。アップロードはワークスペースレベルで行われ、特定のプロジェクトには紐付けられません。返された sourceId は、 images 配列で参照でき、 イベントを作成するときに使用できます。モデルが処理した元のフレームや出力フレームを添付すると、イベントとともに表示できます。

HTTP API

ビジョンイベントで使用する画像をアップロードします。これはワークスペースレベルのアップロードであり、特定のプロジェクトには関連付けられません。返された sourceId は、イベントの作成時に images 配列で参照できます。

必須スコープ: vision-events:write または device:update

Upload a Vision Event Image

post

Upload an image for use in vision events. The image is stored in the workspace, not in a project. Requires the vision-events:write or device:update scope.

認可
Authorizationstring必須

Roboflow API key passed as a Bearer token.

クエリパラメータ
namestringオプション

Custom name for the image. The name form field wins when you send both.

本文
filestring · binary必須

The image file to upload. Supported formats are JPEG, PNG, WebP, GIF, TIFF, BMP, HEIC, and AVIF. Any form field name works for the file.

namestringオプション

Custom name for the image.

Example: inspection-photo.jpg
metadatastringオプション

JSON object string of custom metadata for the image. Same limits as event customMetadata. Max 100 keys. Keys must match [a-zA-Z0-9_ -]+, max 100 characters. Values are a string (max 1000 characters), a number, or a boolean. Keys that start with rf_internal are reserved for Roboflow and are rejected.

Example: {"camera": "cam-1", "shift": "morning"}
レスポンス
201

Image uploaded successfully.

application/json
successbooleanオプション
sourceIdstringオプション

Reference ID. Put it in images[].sourceId when you create an event.

urlstringオプション

Public URL of the uploaded image.

post/vision-events/upload
POST /vision-events/upload HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 108

{
  "file": "binary",
  "name": "inspection-photo.jpg",
  "metadata": "{\"camera\": \"cam-1\", \"shift\": \"morning\"}"
}
{
  "success": true,
  "sourceId": "Pq7sV2kWx9LmN4rT6yZb",
  "url": "https://storage.googleapis.com/roboflow-platform-sources/Xk2mP9qLr4TzW8vN1bYc/Pq7sV2kWx9LmN4rT6yZb/original.jpg"
}

返された sourceId を images[].sourceId に指定して、 ビジョンイベントを作成します.

Python SDK

ビジョンイベントで使用するローカル画像をアップロードします。返された sourceId は、イベントの作成時に images 配列で参照できます。

レスポンスの sourceId は、 images 配列で、 ビジョンイベントを作成する際に使用します:

サポートされている画像形式とメタデータの制約については、 REST APIリファレンスを参照してください.

最終更新

役に立ちましたか?