> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/deployment/ko/monitoring-and-analytics/vision-events/upload-a-vision-event-image.md).

# Vision Event 이미지 업로드

워크스페이스 수준 이미지를 업로드하고 Vision Event를 만들 때 해당 sourceId를 참조합니다.

## 소개

이 엔드포인트는 작업 공간에 이미지를 업로드하여 다음에서 사용하도록 합니다 [비전 이벤트](/deployment/ko/monitoring-and-analytics/vision-events.md). 업로드는 작업 공간 수준이며 어떤 프로젝트에도 연결되지 않습니다. 반환되는 `sourceId` 는 다음에서 참조할 수 있습니다 `images` 배열은 다음을 할 때 [이벤트를 생성합니다](/deployment/ko/monitoring-and-analytics/vision-events/create-a-vision-event.md). 이를 사용해 모델이 처리한 원본 또는 출력 프레임을 첨부하여 이벤트와 함께 볼 수 있게 하세요.

## HTTP API

비전 이벤트에서 사용할 이미지를 업로드합니다. 이는 특정 프로젝트에 연결되지 않는 작업 공간 수준 업로드입니다. 반환되는 `sourceId` 는 다음에서 참조할 수 있습니다 `images` 이벤트 생성 시 배열

**필수 스코프:** `vision-events:write` 중인지 `device:update`

{% openapi src="/files/07bb573a8b2a5a268b550bc4e2d87e5feae31c5d" path="/vision-events/upload" method="post" %}
[openapi.yaml](https://1826078061-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoksNmwps1HmYr8TqHDnX%2Fuploads%2Fgit-blob-90cd0189aea08d3263ce3e004f4958cc7363d4ed%2Fopenapi.yaml?alt=media)
{% endopenapi %}

반환된 `sourceId` 를 `images[].sourceId` 다음을 할 때 [비전 이벤트를 생성합니다](/deployment/ko/monitoring-and-analytics/vision-events/create-a-vision-event.md#http-api).

## Python SDK

비전 이벤트에서 사용할 로컬 이미지를 업로드합니다. 반환되는 `sourceId` 는 다음에서 참조할 수 있습니다 `images` 이벤트 생성 시 배열

```python
import roboflow

roboflow.login()

rf = roboflow.Roboflow()
ws = rf.workspace()

# 이미지 업로드
result = ws.upload_vision_event_image("inspection-photo.jpg")
source_id = result["sourceId"]

# 선택적으로 이름과 메타데이터를 지정할 수도 있습니다
result = ws.upload_vision_event_image(
    "inspection-photo.jpg",
    name="line-a-check-001",
    metadata={"camera": "cam-1", "shift": "morning"},
)
```

plc-cli `sourceId` 응답의 값은 다음에서 사용됩니다 `images` 배열은 다음을 할 때 [비전 이벤트를 생성할 때](/deployment/ko/monitoring-and-analytics/vision-events/create-a-vision-event.md#python-sdk):

```python
ws.write_vision_event({
    "eventId": "d4e5f6a7-b2c3-4d4e-9f6a-7b8c9d0e1f2a",
    "eventType": "quality_check",
    "useCaseId": "a1b3c8e1",
    "timestamp": "2024-01-15T10:30:00Z",
    "images": [
        {
            "sourceId": source_id,
            "label": "inspection-photo",
            "objectDetections": [
                {"class": "defect", "x": 100, "y": 200, "width": 50, "height": 30, "confidence": 0.95}
            ],
        }
    ],
    "eventData": {"result": "fail"},
})
```

지원되는 이미지 형식 및 메타데이터 제약 사항은 다음을 참조하세요 [REST API 참조](#http-api).
