> 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 के साथ जोड़ा जाता है जो downstream application के संचालन को संचालित करती है। कुछ रोचक प्रेरणा के लिए, देखें [Luxonis के उपयोग के मामले](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 types hosted API द्वारा समर्थित हैं:

| कार्य प्रकार                                                                                                                                                                  | Luxonis OAK Deployment द्वारा समर्थित |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| <p>Object Detection:</p><ul><li>Roboflow पर प्रशिक्षित YOLOv8 models (सभी sizes: Nano, Small, Medium, Large, X Large)</li><li>Roboflow पर प्रशिक्षित 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)

#### स्थापना

इंस्टॉल करें `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` ऑब्जेक्ट को instantiate (create) कर रहे हों। Depth वाले OAK के model name के साथ एक "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 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 - preprocs के बाद का frame, predictions के साथ
        #raw_frame - आपके OAK से मूल frame
        #depth - raw_frame के लिए depth map, center camera के साथ center-rectified
        
        # timing: benchmarking उद्देश्यों के लिए
        t = time.time()-t0
        print("FPS ", 1/t)
        print("PREDICTIONS ", [p.json() for p in predictions])

        # depth calculation के लिए parameters सेट करना
        # यदि आप बिना Depth वाले OAK का उपयोग कर रहे हैं, तो निम्नलिखित 2 lines पर टिप्पणी करें
        max_depth = np.amax(depth)
        cv2.imshow("depth", depth/max_depth)
        # video feed को क्रमिक frames के रूप में प्रदर्शित करना
        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 या end inference), अपने 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 स्थापना](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 का उपयोग करते समय 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.
