> 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의 깊이 맵, 중앙 카메라에 맞게 중심 보정됨
        
        # 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", 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
