Hello,
I have an OAK-D-S2 device and everything was working properly using this bunch of code:
from depthai_sdk import OakCamera, ArgsParser
import argparse
import depthai as dai
def a(packet):
for det in packet.detections:
spatials = det.img_detection.spatialCoordinates
print(spatials.x, spatials.y, spatials.z)
# parse arguments
parser = argparse.ArgumentParser()
parser.add_argument("-conf", "--config", help="Trained YOLO json config path", default='model/yolo.json', type=str)
args = ArgsParser.parseArgs(parser)
with OakCamera(args=args) as oak:
stereo = oak.create_stereo(fps=8)
color = oak.create_camera('color', fps=8)
nn = oak.create_nn(args['config'], color, nn_type='yolo', spatial=stereo)
oak.visualize(nn, fps=True, scale=2/3)
oak.callback(nn.out.passthrough, a)
oak.start(blocking=True)
Today, it gave me this error message: **AttributeError: 'NoneType' object has no attribute 'fromopenvino'***
I checked the camera using DepthAI_SDK, and it worked properly.
The code reaches to camera then it is opened and closed instantaneously after opening.
Any help, please?