This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from depthai_sdk import OakCamera | |
import cv2 | |
import depthai as dai | |
import rerun as rr | |
# Run & initialize ReRun viewer | |
rr.init('Rerun Oak-D-LR', spawn=True) | |
# Download and run the tractor recording | |
with OakCamera(replay="tractor-oak-d-lr") as oak: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openai import OpenAI | |
from openai.types.beta.threads.message_create_params import Attachment, AttachmentToolFileSearch | |
import os | |
from dotenv import load_dotenv | |
load_dotenv() | |
import json | |
# Add your OpenAI API key | |
client = OpenAI(api_key=os.getenv("OPENAI_KEY")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import depthai as dai | |
import cv2 | |
pipeline = dai.Pipeline() | |
camA = pipeline.createColorCamera() | |
camA.setBoardSocket(dai.CameraBoardSocket.CAM_A) | |
camA.setResolution(dai.ColorCameraProperties.SensorResolution.THE_12_MP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import depthai as dai | |
import cv2 | |
pipeline = dai.Pipeline() | |
# Define a source - color camera | |
cam = pipeline.create(dai.node.ColorCamera) | |
cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_5312X6000) # 32MP for still images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import cv2 | |
import depthai as dai | |
import numpy as np | |
import time | |
import blobconverter | |
# MobilenetSSD label texts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import depthai as dai | |
import cv2 | |
# Create pipeline | |
pipeline = dai.Pipeline() | |
# Define sources and outputs | |
camRgb = pipeline.create(dai.node.ColorCamera) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import depthai as dai | |
# Connect Device | |
with dai.Device() as device: | |
calibData = device.readCalibration() | |
for cam in device.getConnectedCameraFeatures(): | |
print(f'{cam.name} lens position during calibration: {calibData.getLensPosition(cam.socket)}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import cv2 | |
import numpy as np | |
import depthai as dai | |
# Weights to use when blending depth/rgb image (should equal 1.0) | |
rgbWeight = 0.4 | |
depthWeight = 0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import depthai as dai | |
# Weights to use when blending depth/rgb image (should equal 1.0) | |
rgbWeight = 0.4 | |
depthWeight = 0.6 | |
msgs = dict() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import colorsys | |
import cv2 | |
import math | |
import time | |
def generate_colors(number_of_colors, pastel=0.5): | |
colors = [] |
NewerOlder