- Project Type: Object Detection
- Operating System & Browser: MacOS Sonoma with M1 chip
- Project Universe Link or Workspace/Project ID: How to Use the DECCv3 Object Detection API
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