This file contains hidden or 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 | |
# Create pipeline | |
pipeline = dai.Pipeline() | |
# Define sources and output | |
camRgb = pipeline.create(dai.node.ColorCamera) | |
videoEnc = pipeline.create(dai.node.VideoEncoder) |
This file contains hidden or 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 | |
from datetime import timedelta | |
import cv2 | |
import depthai as dai | |
# Create pipeline | |
pipeline = dai.Pipeline() | |
FPS = 30 |
This file contains hidden or 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 json | |
import colorsys | |
import cv2 | |
import numpy as np | |
def sam_results(file): | |
with open(file, 'r') as file: | |
lines = file.readlines() | |
data = [] | |
for line in lines: |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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)}') |
NewerOlder