# Problem trying to connect OAK-1 with roboflow pretrained model in real time

**URL:** <https://discuss.roboflow.com/t/problem-trying-to-connect-oak-1-with-roboflow-pretrained-model-in-real-time/6613>\
**Category:** 🤝  Community Help\
**Created:** [July 25, 2024, 5:58am UTC](https://discuss.roboflow.com/t/problem-trying-to-connect-oak-1-with-roboflow-pretrained-model-in-real-time/6613 "2024-07-25T05:58:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhenriquezsoto](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/bhenriquezsoto/32/5161_2.png) [@bhenriquezsoto](https://discuss.roboflow.com/u/bhenriquezsoto)\
**Post date:** [July 25, 2024, 5:58am UTC](https://discuss.roboflow.com/t/problem-trying-to-connect-oak-1-with-roboflow-pretrained-model-in-real-time/6613/1 "2024-07-25T05:58:41Z")

</div>

Hi, I hope you’re doing god 🙂

I was hoping to get your help in this problem please ☹

```auto

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

if __name__ == ' __main__':
    # instantiating an object (rf) with the RoboflowOak module
    rf = RoboflowOak(model="landing-pad-model", confidence=0.05, overlap=0.5,
    version="3", api_key="XXXXXXXX", rgb=True,
    depth=False, 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

```

I’ve been trying to run this code in my oak-1 camera with a pretrained model in real time but i’m getting this error:

```auto
 /home/user/.cache/pypoetry/virtualenvs/caleuche-Y4yvr6Xo-py3.10/bin/python3.10 /home/user/Documents/2024-02/Caleuche/frame-detection/model_inference.py
Traceback (most recent call last):
  File "/home/user/Documents/2024-02/Caleuche/frame-detection/model_inference.py", line 8, in <module>
    rf = RoboflowOak(model="landing-pad-model", confidence=0.05, overlap=0.5,
  File "/home/user/.cache/pypoetry/virtualenvs/caleuche-Y4yvr6Xo-py3.10/lib/python3.10/site-packages/roboflowoak/ __init__.py", line 34, in __init__
    self.size = (int(self.model_objects["environment"]["RESOLUTION"]), int(self.model_objects["environment"]["RESOLUTION"]))
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'

```

Right now i’m using ubuntu 22.04 with an intel cpu, without gpu. Any feedback about what should I make next please?

The camera worked well when I tried it with the depthAI Demo

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/1X/bb6edbfa56d0cf2ee603f061e9e09103502cc8cc.png) [@system](https://discuss.roboflow.com/u/system)\
**Post date:** [August 15, 2024, 5:58am UTC](https://discuss.roboflow.com/t/problem-trying-to-connect-oak-1-with-roboflow-pretrained-model-in-real-time/6613/2 "2024-08-15T05:58:44Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
