Code SamplesΒΆ
Code samples are used for automated testing. They are also a great starting point for the DepthAI SDK, as different component functionalities are presented with code.
ColorCamera
FFC Camera Visualization - Preview FFC Cameras
Camera Control - Demonstrates RGB camera control from the host
Camera Preview - Preview color, right, left and depth frames
Camera Control with NN - Control camera (focus, exposure) with NN detections
Mono Camera Preview - Preview mono cameras with manual 400p resolution
Preview All Cameras - Preview all cameras connected to the OAK device
RGB and Mono Preview - Preview RGB and mono cameras
Camera Rotated Preview - Demonstrates how to rotate the camera previews
Mixed
API Interoperability Example - Demonstrates interoperability between the DepthAI API and the SDK
Car Tracking Example - Demonstrates how to run inference on a pre-saved video
Collision Avoidance - Demonstrates how to run collision avoidance
Speed Calculation Preview - Demonstrates how to calculate speed of detected objects in the frame`
Switch Between Models - Demonstrates how to switch between models
Sync Multiple Outputs - Demonstrates how to sync multiple outputs
IMU
IMU Demonstration - Demonstrates how to use and display the IMU
IMU Rerun Demonstration - Demonstrates how use and display the IMU in Rerun
NN
Age-Gender Inference - Demonstrates age-gender inference
Custom Decode Function - Demonstrates custom decoding function
Emotion Recognition - Demonstrates emotion recognition
Face Detection RGB - Run face detection on RGB camera
Face Detection Mono - Run face detection on mono camera
Human Pose Estimation - Run human pose estimation inference
MobileNet Encoded - Pass encoded color stream to the NN (MobileNet)
Neural Network Component - Run color camera stream through NN (YoloV7)
Object Tracking - Tracking objects in the frame
Roboflow Integration - Demonstrates how to use Roboflow platform to train a custom model
Spatial Detection - Perform spatial detection with at MobileNet model
YOLO SDK - Run YoloV3 inference on the color camera stream
Pointcloud
Pointcloud Demo - Preview pointcloud with rerun viewer
Recording
Encode Multiple Streams - Demonstrates how to encode multiple (color, left, right) streams and save them to a file
Preview Encoder - Record color camera stream and save it as mjpeg
MCAP Recording - Record color, left, right and depth streams and save them to a MCAP
MCAP IMU Recording - Record IMU and depth streams and save them to a MCAP
Hardcode Recording Duration - Record color camera stream for a specified duration
ROSBAG Recording - Record IMU, left, right and depth streams and save them to a ROSBAG
Stereo Recording - Records disparity stream
Replay
Object counting on images - Count number of objects on a folder of images (cycle through images every 3 sec)
People Tracker on Video Replay - Run people tracker on a pre-saved video
Face Detection Inference on Downloaded Image - Run face detection on a downloaded image
Vehicle Detection on a Youtube Video - Run vehicle detection on a Youtube video stream
Looped Replay - Replay a pre-saved video in a loop
Stereo
Stereo Preview - Display WLS filtered disparity map
Auto IR Brightness - Demonstrates the use of auto IR brightness function
Stereo Control - Demonstrates stereo control (median filter, decimation factor, confidence threshold) from the host
Stereo Encoding - Demonstrates how to encode stereo stream and visualize it
Streaming
ROS Publishing - Publish color, left, right and IMU streams to ROS
Trigger Action
Custom Trigger Action - Demonstrates how to set a custom trigger action
Custom Trigger - Demonstrates how to set a custom trigger
Person Record - Demonstrates how to record a person when a person is detected
Visualizer
Visualizer Demo - Demonstrates how to use the visualizer
Visualizer Callback Function - Demonstrates how to set the visualizer callback function