Trained Model does not find predections on OAK-1

I have trained a model using Roboflow work space. The model works fine with web cam web interface.

When I try running the inference on OAK-1 from below code. I can see the stream but no predictions found. I would appreciate any inputs regarding this.

Hi @Sergio_Castellanos

We pushed a fix for our OAK deployment yesterday. Can you confirm that you’re using version 0.0.11 (or later)?

You can update using pip:
pip install roboflowoak==0.0.11

Hi Leo
I confirm you that I installed the version roboflowoak==0.0.11, but it generated the following error

Traceback (most recent call last):
File “C:\Users\ingca\AppData\Local\Programs\Python\Python311\Lib\site-packages\roboflowoak_init_.py”, line 72, in init
self.dai_pipe = DepthAIPipeline(
^^^^^^^^^^^^^^^^
File “C:\Users\ingca\AppData\Local\Programs\Python\Python311\Lib\site-packages\roboflowoak\pipe.py”, line 87, in init
self.cam_rgb.out.link(self.detection_nn.input)
^^^^^^^^^^^^^^^^
AttributeError: ‘depthai.node.ColorCamera’ object has no attribute ‘out’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\ingca\AppData\Local\Programs\Python\Python311\Lib\site-packages\roboflowoak_init_.py”, line 104, in init
self.dai_pipe = DepthAIPipeline(
^^^^^^^^^^^^^^^^
File “C:\Users\ingca\AppData\Local\Programs\Python\Python311\Lib\site-packages\roboflowoak\pipe.py”, line 87, in init
self.cam_rgb.out.link(self.detection_nn.input)
^^^^^^^^^^^^^^^^
AttributeError: ‘depthai.node.ColorCamera’ object has no attribute ‘out’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\ingca\OneDrive\Documentos\Proyecto\Proyecto.py”, line 8, in
rf = RoboflowOak(model=“trabajo-de-grado-final”, confidence=0.05,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\ingca\AppData\Local\Programs\Python\Python311\Lib\site-packages\roboflowoak_init_.py”, line 123, in init
raise Exception(
Exception: Failure while retrying load weights - does this model, version, api key exist? can you curl api.roboflow.com, and can your device download files from google cloud storage? have you hit your device limit?

  • this is the code I’m running

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=“trabajo-de-grado-final”, confidence=0.05,
overlap=0.5, version=“2”,
api_key=“aDBlDcA4YIxszVDvS6WH”, rgb=True, depth=False,
device=None, device_name=None, blocking=True)
while True:
t0 = time.time()
result, frame, raw_frame, depth = rf.detect(visualize=True)
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
# To access specific values within “predictions” use:
# p.json()[a] for p in predictions
# set “a” to the index you are attempting to access
# Example: accessing the “y”-value:
# p.json()[‘y’] for p in predictions

    t = time.time()-t0
    print("INFERENCE TIME IN MS ", 1/t)
    print("PREDICTIONS ", [p.json() for p in predictions])
    
    # setting parameters for depth calculation
    #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 have been following this thread as I’ve also been experiencing the same failure as @Sergio_Castellanos (and others) to get inferencing running on an Oak device.

I can add that I am getting the identical exceptions/errors as reported by @Sergio using roboflowoak 0.0.11

@Sergio_Castellanos: I’m investigating your issue, but in the meantime, I’ve revoked the use of your API key, which you published in your post. You can generate a new one in your settings. In the future, please be careful to post information that could give others unauthorized access to your accounts.

@Sergio_Castellanos

1 Like

Hi Leo an Larry , thanks for your support and solution, I confirm that when I install the version roboflowoak==0.0.12 and run the script, the roboflow integration with my oak -1 camera works perfectly.

great job

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