Roboflow model does not deploy to Oak D-Lite

I am trying to deploy my model to an OAK-D Lite, but when I execute my python script, I get the error message:

File "/Users/emmaiverson/Luxonis/depthai/legoExample/lego3.py", line 8, in <module>
    rf = RoboflowOak(model="deccv3-vr35s", version="5", api_key="qp2BshcnAkF46Pg30wnP", confidence=0.05, overlap=0.5, rgb=True, depth=True, device=None, blocking=True)
  File "/Users/emmaiverson/Library/Python/3.10/lib/python/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'

Why am I getting this error in the init.py file?
My python code:

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="deccv3-vr35s", version="5", api_key="XXX...XXX", confidence=0.05, overlap=0.5, 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

I’m sorry, but your question seems to be incomplete. Could you please provide more details or context? Are you asking about how to create an Object Detection project on Roboflow, or are you asking about the system requirements for running Roboflow on a specific operating system? The more details you provide, the better I can assist you.


Hi! I’m Roboflow’s AI powered bot. This is an automated response powered using AI with knowledge from our docs, blog, and forum. If this solves your issue, please mark it as the solution using the checkbox icon. If this doesn’t solve your issue, please follow up with what you’ve tried/why, and the community will continue to chime in as usual.

Hi @emma-iverson ! It looks like we may have some out of date docs that lead you to using roboflowoak. The best route to follow is to use the official roboflow integration in the DepthAI package. You can follow this guide to see how that’s done: Deploy Models from Roboflow with the Luxonis DepthAI SDK

1 Like

Hi Paul, thank you for the reply. I re-downloaded depthai and followed the instructions for the M1 Macs. This is my updated code:

from depthai_sdk import OakCamera
import depthai


with OakCamera() as oak:
    color = oak.create_camera('color')
    model_config = {
        'source': 'roboflow', # Specify that we are downloading the model from Roboflow
        'model':'deccv3-vr35s/6',
        'key':'XXXXXXXXX' 
    }
    nn = oak.create_nn(model_config, color)
    oak.visualize(nn, fps=True)
    oak.start(blocking=True)

However, I get this error message about not finding a URL:

➜ python3 lego.py
Downloading ‘DECCv3’ model from Roboflow server
Closing OAK camera
Traceback (most recent call last):
File “/Users/emmaiverson/depthai/lego.py”, line 16, in
oak.start(blocking=True)
File “/Users/emmaiverson/Library/Python/3.10/lib/python/site-packages/depthai_sdk/oak_camera.py”, line 286, in start
self.build() # Build the pipeline
File “/Users/emmaiverson/Library/Python/3.10/lib/python/site-packages/depthai_sdk/oak_camera.py”, line 380, in build
component.on_init(self._pipeline, self._oak.device, self._pipeline.getOpenVINOVersion())
File “/Users/emmaiverson/Library/Python/3.10/lib/python/site-packages/depthai_sdk/components/nn_component.py”, line 124, in on_init
path = self._roboflow.device_update(device)
File “/Users/emmaiverson/Library/Python/3.10/lib/python/site-packages/depthai_sdk/components/integrations/roboflow.py”, line 53, in device_update
zipFileReq.raise_for_status()
File “/Users/emmaiverson/Library/Python/3.10/lib/python/site-packages/requests/models.py”, line 953, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://storage.googleapis.com/roboflow-platform-train/skvC520GouROQD0JPtr0dwYuags2/HZTxMw8LigoKuj5XxpB6/6/roboflow.zip?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=481589474394-compute%40developer.gserviceaccount.com%2F20240216%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20240216T035221Z&X-Goog-Expires=900&X-Goog-SignedHeaders=host&X-Goog-Signature=2085aea987ccbf58e849f10c3a4c13523a93d7011cd4a7ac063d73914b371650d1024aa3a66c8c914a49a3dc741df39244a18fadd681755fe14e4085e3e36b135146669577ad7b9482089ae2e537cf6e4c6e852b9779133156561c606aa84c83e0aea9706a6942db7454c8c2730ce416c9042f11afe1f6324422043e40ea5fe44c993d97c58bdef78b2b19dd876ce71bafc010ef6ab52aafc5a5b5b7b60abae797f502605f500f93b9d56c951f742783dad40f9dd45711c2ff5ba10422b3ddf301fb7592aabea419595e6d08f7c2b71708b806f7314f06b6979e829fc78679935c8c3103f1617dbf489c558f129dffe50bf6ab0109d2223c08256fd1aa1baa41
(base)

Do you know why my model is not deploying to my Oak-D Lite?