- Edited
Hi there, I have an OAK-D Lite camera and I want to use it to detect drones and their distance relative to the camera. I am using a YOLOv6-N model as it is lightweight and seems to be a pretty popular choice amongst OAK-D Lite projects. The script that I am running to detect drone's and their distance relative to the camera is:
from depthai_sdk
import OakCamera, ArgsParser
import argparse
# parse arguments
parser = argparse.ArgumentParser()
parser.add_argument("-conf", "--config", help="Trained YOLO json config path", default='models/v1/16shaves/droneDetection_v1.json', type=str)
args = ArgsParser.parseArgs(parser)
with OakCamera(args=args) as oak:
color = oak.create_camera('color')
nn = oak.create_nn(args['config'], color, nn_type='yolo', spatial=True)
oak.visualize(nn, fps=True)
oak.start(blocking=True)
This code outputs the following, the bottom-right of the bounding box lies the coveted Z-parameter - "0.9m":
(sorry for the low-res)
I want to extract the Z-parameter into a variable, and I am very unsure of how to do so. I've tried using many different examples from the documentation and other sources, but to no avail.
Any help would be appreciated!