# OakD Deployment Failure

**URL:** <https://discuss.roboflow.com/t/oakd-deployment-failure/1212>\
**Category:** 🤝  Community Help\
**Created:** [December 27, 2022, 2:49am UTC](https://discuss.roboflow.com/t/oakd-deployment-failure/1212 "2022-12-27T02:49:07Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Mohamed](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamed/32/62_2.png) [@Mohamed](https://discuss.roboflow.com/u/Mohamed)\
**Post date:** [January 6, 2023, 7:01pm UTC](https://discuss.roboflow.com/t/oakd-deployment-failure/1212/3 "2023-01-06T19:01:21Z")

</div>

Hi @MacAutoPlow you’ll just want to remove `visualize=True` from `rf.detect()`.

We made some updates that have made that addition unnecessary. I’ll update the comment on the old thread as well.

Here are the docs with the sample code snippet: [Luxonis OAK (On Device) - Roboflow](https://docs.roboflow.com/inference/luxonis-oak#running-inference-deployment)

Example with [my Face Detection dataset](https://app.roboflow.com/mohamed-traore-2ekkp/face-detection-mik1i/15):

- Publicly viewable link for the project: [Face Detection Object Detection Dataset (v15, v2-resize640\_augmented3x) by Mohamed Traore](https://universe.roboflow.com/mohamed-traore-2ekkp/face-detection-mik1i/15)

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/b/b1d0c2664e216548cfa5cdc6e03ff8bb57df4997.png)

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

if __name__ == ' __main__':
    # instantiating an object (rf) with the RoboflowOak module
    # API Key: https://docs.roboflow.com/rest-api#obtaining-your-api-key
    rf = RoboflowOak(model="face-detection-mik1i", confidence=0.05, overlap=0.5,
    version="15", api_key="XXXXXXXX", rgb=True,
    depth=True, device=None, blocking=True)
    # Running our model and displaying the video output with detections
    while True:
        t0 = time.time()
        # The rf.detect() function runs the model inference
        result, frame, raw_frame, depth = rf.detect()
        predictions = result["predictions"]
        #{
        # predictions:
        # [ {
        # x: (middle),
        # y:(middle),
        # width:
        # height:
        # depth: ###->
        # confidence:
        # class:
        # mask: {
        # ]
        #}
        #frame - frame after preprocs, with predictions
        #raw_frame - original frame from your OAK
        #depth - depth map for raw_frame, center-rectified to the center camera
        
        # timing: for benchmarking purposes
        t = time.time()-t0
        print("FPS ", 1/t)
        print("PREDICTIONS ", [p.json() for p in predictions])

        # setting parameters for depth calculation
        # comment out the following 2 lines out if you're using an OAK without Depth
        max_depth = np.amax(depth)
        cv2.imshow("depth", depth/max_depth)
        # displaying the video feed as successive frames
        cv2.imshow("frame", frame)
    
        # how to close the OAK inference window / stop inference: CTRL+q or CTRL+c
        if cv2.waitKey(1) == ord('q'):
            break

```

---

_[View the full topic](https://discuss.roboflow.com/t/oakd-deployment-failure/1212)._
