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

# Luxonis OAK

यह [Luxonis OAK (OpenCV AI Kit)](https://shop.luxonis.com/) एक edge device है जिसका उपयोग embedded computer vision systems की deployment के लिए व्यापक रूप से किया जाता है।

OAK devices एक host machine के साथ paired होते हैं जो downstream application के operation को drive करती है। कुछ प्रेरणादायक उदाहरणों के लिए देखें [Luxonis के use cases](https://docs.luxonis.com/en/latest/#example-use-cases) और [Roboflow के case studies](https://blog.roboflow.com/tag/case-studies/).

**वैसे:** अगर आपके पास अभी तक आपका OAK device नहीं है, तो आप [Roboflow Store के माध्यम से एक खरीद सकते हैं](https://store.roboflow.com/) 10% की छूट पाने के लिए।

### Task Support

निम्नलिखित task types hosted API द्वारा समर्थित हैं:

| Task Type                                                                                                                                                               | Luxonis OAK Deployment द्वारा समर्थित |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| <p>Object Detection:</p><ul><li>Roboflow पर trained YOLOv8 models (सभी sizes: Nano, Small, Medium, Large, X Large)</li><li>Roboflow पर trained YOLOv11 models</li></ul> | ✅                                     |
| Classification                                                                                                                                                          |                                       |
| Instance Segmentation                                                                                                                                                   |                                       |
| Semantic Segmentation                                                                                                                                                   |                                       |

### Luxonis OAK पर एक Model Deploy करें

#### समर्थित Luxonis Devices और Host Requirements

Roboflow Inference Server निम्नलिखित devices को support करता है:

* OAK-D
* OAK-D-Lite
* OAK-D-POE
* OAK-1 (no depth)

#### Installation

इंस्टॉल करें `roboflowoak`, `depthai`और `opencv-python` packages:

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

अब आप `roboflowoak` package का उपयोग करके अपना custom trained Roboflow model चला सकते हैं।

#### Inference चलाना: Deployment

यदि आप Depth capabilities के बिना किसी OAK device पर deploy कर रहे हैं, तो सेट करें `depth=False` जब आप `rf` object को instantiate (create) करें। Depth वाले OAKs के model name के साथ "D" जुड़ा होता है, यानी OAK-D और OAK-D-Lite।

साथ ही, comment out करें `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 module के साथ एक object (rf) instantiate करना
    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)
    # अपना model चलाना और detections के साथ video output दिखाना
    while True:
        t0 = time.time()
        # rf.detect() function model inference चलाती है
        result, frame, raw_frame, depth = rf.detect()
        predictions = result["predictions"]
        #{
        #    predictions:
        #    [ {
        #        x: (middle),
        #        y:(middle),
        #        width:
        #        height:
        #        depth: ###->
        #        confidence:
        #        class:
        #        mask: {
        #    ]
        #}
        #frame - preprocessing के बाद frame, predictions के साथ
        #raw_frame - आपके OAK से original frame
        #depth - raw_frame के लिए depth map, center camera के अनुसार center-rectified
        
        # timing: benchmarking purposes के लिए
        t = time.time()-t0
        print("FPS ", 1/t)
        print("PREDICTIONS ", [p.json() for p in predictions])

        # depth calculation के लिए parameters सेट करना
        # यदि आप Depth के बिना OAK का उपयोग कर रहे हैं, तो निम्नलिखित 2 lines comment out करें
        max_depth = np.amax(depth)
        cv2.imshow("depth", depth/max_depth)
        # successive frames के रूप में video feed display करना
        cv2.imshow("frame", frame)
    
        # OAK inference window को बंद करने / inference रोकने का तरीका: CTRL+q या CTRL+c
        if cv2.waitKey(1) == ord('q'):
            break
```

नीचे दिया गया code दर्ज करें (placeholder text को अपनी Python script के path से बदलने के बाद)

```python
# window बंद करने के लिए (interrupt या inference end करने के लिए), अपने keyboard पर CTRL+c दर्ज करें
python3 /path/to/[YOUR-PYTHON-FILE].py
```

Apple Macbook Air (M1) को host device के रूप में उपयोग करने पर inference speed (milliseconds में) औसतन लगभग 15 ms, या 66 FPS रही। ***नोट**: OAK के साथ उपयोग किया गया host device FPS को बहुत अधिक प्रभावित करेगा। अपना system बनाते समय इसे ध्यान में रखें।*

#### समस्या निवारण

यदि आपको अपना OAK device सेटअप करने में समस्या आ रही है, तो Luxonis' installation instructions देखें और सुनिश्चित करें कि आप पर RGB example सफलतापूर्वक चला सकते हैं [Luxonis installation](https://docs.luxonis.com/en/latest/#demo-script). आप सहायता के लिए [Roboflow Forum](https://discuss.roboflow.com/).

### यह भी देखें

* [स्टेप-बाय-स्टेप Luxonis OAK setup guide](https://blog.roboflow.com/opencv-ai-kit-deployment/)
* [M1 Chip का उपयोग करते समय Installation issue · 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-hi/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.
