> 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/roboflow/roboflow-ko/deploy/sdks/luxonis-oak.md).

# Luxonis OAK

해당 [Luxonis OAK (OpenCV AI Kit)](https://shop.luxonis.com/) 은 임베디드 컴퓨터 비전 시스템의 배포에 널리 사용되는 엣지 디바이스입니다.

OAK 디바이스는 다운스트림 애플리케이션의 동작을 구동하는 호스트 머신과 함께 사용됩니다. 흥미로운 영감을 위해 다음을 참조하세요: [Luxonis의 사용 사례](https://docs.luxonis.com/en/latest/#example-use-cases) 및 [Roboflow의 사례 연구](https://blog.roboflow.com/tag/case-studies/).

**참고로:** 아직 OAK 디바이스가 없다면, 다음을 할 수 있습니다 [Roboflow Store를 통해 하나를 구매하여](https://store.roboflow.com/) 10% 할인을 받으세요.

### 작업 지원

다음 작업 유형은 호스티드 API에서 지원됩니다:

| 작업 유형                                                                                                                                 | Luxonis OAK Deployment에서 지원됨 |
| ------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| <p>객체 감지:</p><ul><li>Roboflow에서 학습된 YOLOv8 모델(모든 크기: Nano, Small, Medium, Large, X Large)</li><li>Roboflow에서 학습된 YOLOv11 모델</li></ul> | ✅                            |
| 분류                                                                                                                                    |                              |
| 인스턴스 세그멘테이션                                                                                                                           |                              |
| 시맨틱 세그멘테이션                                                                                                                            |                              |

### Luxonis OAK에 모델 배포

#### 지원되는 Luxonis 디바이스 및 호스트 요구 사항

Roboflow Inference Server는 다음 디바이스를 지원합니다:

* OAK-D
* OAK-D-Lite
* OAK-D-POE
* OAK-1 (depth 없음)

#### 설치

다음 패키지를 설치하세요: `roboflowoak`, `depthai`, 및 `opencv-python` 패키지:

```python
pip install roboflowoak
pip install depthai
pip install opencv-python
```

이제 다음을 사용할 수 있습니다 `roboflowoak` 패키지로 사용자 지정 학습한 Roboflow 모델을 실행할 수 있습니다.

#### 추론 실행: 배포

Depth 기능이 없는 OAK 디바이스에 배포하는 경우, 다음을 설정하세요 `depth=False` 를 인스턴스화(생성)할 때 `rf` 객체를. Depth가 있는 OAK에는 모델 이름에 "D"가 붙습니다. 예: OAK-D 및 OAK-D-Lite.

또한 다음을 주석 처리하세요 `max_depth = np.amax(depth)` 및 `cv2.imshow("depth", depth/max_depth)`

```python
from roboflowoak import RoboflowOak
import cv2
import time
import numpy as np

if __name__ == '__main__':
    # RoboflowOak 모듈로 객체(rf)를 인스턴스화합니다
    rf = RoboflowOak(model="YOUR-MODEL-ID", confidence=0.05, overlap=0.5,
    version="YOUR-MODEL-VERSION-#", api_key="YOUR-PRIVATE_API_KEY", rgb=True,
    depth=True, device=None, blocking=True)
    # 모델을 실행하고 탐지가 포함된 비디오 출력을 표시합니다
    while True:
        t0 = time.time()
        # rf.detect() 함수는 모델 추론을 실행합니다
        result, frame, raw_frame, depth = rf.detect()
        predictions = result["predictions"]
        #{
        #    predictions:
        #    [ {
        #        x: (가운데),
        #        y:(가운데),
        #        width:
        #        height:
        #        depth: ###->
        #        confidence:
        #        class:
        #        mask: {
        #    ]
        #}
        #frame - 사전 처리 후 예측이 포함된 프레임
        #raw_frame - OAK의 원본 프레임
        #depth - raw_frame의 depth 맵, 중앙 카메라에 맞춰 중심 정렬됨
        
        # timing: 벤치마킹용
        t = time.time()-t0
        print("FPS ", 1/t)
        print("PREDICTIONS ", [p.json() for p in predictions])

        # 깊이 계산을 위한 매개변수 설정
        # Depth가 없는 OAK를 사용하는 경우 다음 2줄을 주석 처리하세요
        max_depth = np.amax(depth)
        cv2.imshow("depth", depth/max_depth)
        # 연속 프레임으로 비디오 피드를 표시합니다
        cv2.imshow("프레임", frame)
    
        # OAK 추론 창을 닫는 방법 / 추론 중지: CTRL+q 또는 CTRL+c
        if cv2.waitKey(1) == ord('q'):
            break
```

아래 코드를 입력하세요(플레이스홀더 텍스트를 Python 스크립트 경로로 바꾼 후)

```python
# 창을 닫으려면(중단하거나 추론을 종료하려면) 키보드에서 CTRL+c를 입력하세요
python3 /path/to/[YOUR-PYTHON-FILE].py
```

Apple Macbook Air (M1)을 호스트 디바이스로 사용했을 때의 추론 속도(밀리초)는 평균 약 15ms, 즉 66 FPS였습니다. ***참고**: OAK와 함께 사용하는 호스트 디바이스는 FPS에 큰 영향을 미칩니다. 시스템을 만들 때 이를 고려하세요.*

#### 문제 해결

OAK 디바이스 설정에 문제가 있다면 Luxonis의 설치 안내를 확인하고, 다음에서 RGB 예제를 성공적으로 실행할 수 있는지 확인하세요 [Luxonis 설치](https://docs.luxonis.com/en/latest/#demo-script). 또한 다음 곳에 도움을 요청할 수도 있습니다: [Roboflow Forum](https://discuss.roboflow.com/).

### 관련 내용

* [단계별 Luxonis OAK 설정 가이드](https://blog.roboflow.com/opencv-ai-kit-deployment/)
* [M1 Chip 사용 시 설치 문제 · Issue #299 · luxonis/depthai · GitHub](https://github.com/luxonis/depthai/issues/299) (depthai SDK)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-ko/deploy/sdks/luxonis-oak.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
