• Stars
    star
    901
  • Rank 50,322 (Top 1.0 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DepthAI Python API utilities, examples, and tutorials.

DepthAI API Demo Program

Discord Forum Docs License: MIT

This repo contains demo application, which can load different networks, create pipelines, record video, etc.

Click on the GIF below to see a full example run

depthai demo

Documentation is available at https://docs.luxonis.com/en/latest/pages/tutorials/first_steps/.

Installation

There are two installation steps that need to be performed to make sure the demo works:

  • One-time installation that will add all necessary packages to your OS.

    $ sudo curl -fL https://docs.luxonis.com/install_dependencies.sh | bash
    

    Please follow this installation page to see instructions for other platforms

  • Python dependencies installation that makes sure your Python interpreter has all required packages installed. This script is safe to be run multiple times and should be ran after every demo update

    $ python3 install_requirements.py
    

Docker

One may start any DepthAI programs also through Docker: (Allowing X11 access from container might be required: xhost local:root)

DepthAI Demo

docker run --privileged -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule='c 189:* rmw' -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --network host --rm -i -t luxonis/depthai:latest python3 /depthai/depthai_demo.py

Calibration

docker run --privileged -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule='c 189:* rmw' -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --network host --rm -i -t luxonis/depthai:latest python3 /depthai/calibrate.py [parameters]

Usage

This repository and the demo script itself can be used in various independent cases:

  • As a tool to try out different DepthAI features, explorable either with command line arguments (with --guiType cv) or in clickable QT interface (with --guiType qt)
  • As a quick prototyping backbone, either utilising callbacks mechanism or by extending the Demo class itself

QT GUI usage

See instuctions here

qt demo

Command line usage

Examples

python3 depthai_demo.py -gt cv - RGB & CNN inference example

python3 depthai_demo.py -gt cv -vid <path_to_video_or_yt_link> - CNN inference on video example

python3 depthai_demo.py -gt cv -cnn person-detection-retail-0013 - Runs person-detection-retail-0013 model from resources/nn directory

python3 depthai_demo.py -gt cv -cnn tiny-yolo-v3 -sh 8 - Run tiny-yolo-v3 model from resources/nn directory and compile for 8 shaves

Demo

cv demo

For the full reference, run $ depthai_demo.py --help.

DepthAI Apps

We currently have 2 apps, uvc and record.

UVC app

This app will upload an UVC pipeline to the connected OAK camera, so you will be able to use an OAK as a webcam.

Record App

Record app lets you record encoded and synced video streams (MJPEG/H265) across all available devices into .mp4, Foxglove's .MCAP, or ROS' .bag . Since mono streams are synced, you will be able to reconstruct the whole stereo depth perception.

Run using $ depthai_demo.py -app record [-p SAVE_PATH] [-q QUALITY] [--save STREAMS] [-fc] [-tl]. More information about the arguments and replaying can be found here.

Supported models

We have added support for a number of different AI models that work (decoding and visualization) out-of-the-box with the demo. You can specify which model to run with -cnn argument, as shown above. Currently supported models:

- deeplabv3p_person
- face-detection-adas-0001
- face-detection-retail-0004
- human-pose-estimation-0001
- mobilenet-ssd
- openpose2
- pedestrian-detection-adas-0002
- person-detection-retail-0013
- person-vehicle-bike-detection-crossroad-1016
- road-segmentation-adas-0001
- tiny-yolo-v3
- vehicle-detection-adas-0002
- vehicle-license-plate-detection-barrier-0106
- yolo-v3

If you would like to use a custom AI model, see documentation here.

Usage statistics

By default, the demo script will collect anonymous usage statistics during runtime. These include:

  • Device-specific information (like mxid, connected cameras, device state and connection type)
  • Environment-specific information (like OS type, python version, package versions)

We gather this data to better understand what environemnts are our users using, as well as assist better in support questions.

All of the data we collect is anonymous and you can disable it at any time. To do so, click on the "Misc" tab and disable sending the statistics or create a .consent file in repository root with the following content

{"statistics": false}

Reporting issues

We are actively developing the DepthAI framework, and it's crucial for us to know what kind of problems you are facing. If you run into a problem, please follow the steps below and email [email protected]:

  1. Run log_system_information.sh and share the output from (log_system_information.txt).
  2. Take a photo of a device you are using (or provide us a device model)
  3. Describe the expected results;
  4. Describe the actual running results (what you see after started your script with DepthAI)
  5. How you are using the DepthAI python API (code snippet, for example)
  6. Console output

More Repositories

1

depthai-experiments

Experimental projects we've done with DepthAI.
Jupyter Notebook
800
star
2

depthai-hardware

Altium Designs for DepthAI Carrier Boards
HTML
433
star
3

depthai-python

DepthAI Python Library
C++
340
star
4

depthai-ros

Official ROS Driver for DepthAI Sensors.
C++
239
star
5

depthai-core

DepthAI C++ Library
C++
227
star
6

depthai-unity

DepthAI Unity Library, Unity projects and examples (OAK For Unity)
C#
200
star
7

depthai-ml-training

Some Example Neural Models that we've trained along with the training scripts
Jupyter Notebook
118
star
8

datadreamer

Creation of annotated datasets from scratch using Generative AI and Foundation Computer Vision models
Python
76
star
9

depthai-gui

DepthAI Pipeline Builder GUI
Python
71
star
10

depthai-ros-examples

Python
40
star
11

depthai-tutorials

Source code for DepthAI tutorials published @ https://docs.luxonis.com
Python
39
star
12

depthai-model-zoo

DepthAI Model Zoo is a collection of open-source neural network models and datasets created and maintained by DepthAI developers and community
SCSS
34
star
13

esp32-spi-message-demo

ESP32 reference app for interfacing with DepthAI over SPI
C++
31
star
14

rae-ros

Implementation of RAE ROS and gazebo stack
Python
30
star
15

tools

Various tools for OAK-D camera
Jupyter Notebook
26
star
16

depthai-docs-website

The documentation site for Luxonis DepthAI
CSS
25
star
17

Factory-calibration-DepthAI

Factory Calibration for DepthAI Stereo-capable models.
Python
17
star
18

depthai-shared

DepthAI Shared code and data
C++
16
star
19

blobconverter

Web-based tool to convert model into MyriadX blob
Python
15
star
20

depthai-core-example

CMake C++ example project using depthai library
CMake
14
star
21

models

Repository of lightweight models for classification, object detection, segmentation and more. Deployable to OAK-D, OpenVINO, and ONNX.
Python
14
star
22

luxonis-ml

Luxonis ML library which abstracts logging, tracking, and other useful functionalities.
Python
13
star
23

DepthAI-PyFlow

OUTDATED, see here - https://github.com/luxonis/depthai-gui
Python
11
star
24

XLink

A cross-platform library for communicating with devices over various physical links.
C
11
star
25

yolo2openvino

YoloV3, YoloV4, YoloV3-tiny, and YoloV4-tiny conversion to Tensorflow and OpenVINO.
Python
10
star
26

depthai-docker

Python
8
star
27

luxonis-train

Training framework for easy creation, training and exporting of deep learning models.
Python
8
star
28

remote-monitoring

JavaScript
7
star
29

depthai-poe-webapp

DepthAI WebApp for PoE devices
Python
7
star
30

robothub-images

Shell
6
star
31

modelconverter

Model converter for Luxonis' cameras. Convert your model from ONNX, TF, ... to a model compatible with any generation of Luxonis camera.
Python
6
star
32

depthai-spi-api

C++
4
star
33

robothub-examples

Python
3
star
34

robothub-public-apps

Python
3
star
35

depthai-boards

Files with hardware descriptions for depthai boards
Python
3
star
36

simulation

3
star
37

depthai-calibration

Python
2
star
38

depthai-ros-release

Release repository of depthai-ros
2
star
39

depthai-spi-library

DepthAI SPI Library
C
2
star
40

depthai-bootloader-shared

Shared code and data for depthai-bootloader
C++
2
star
41

python-api-analyzer-to-json

Python
1
star
42

robothub

Python
1
star
43

SBR

Library and utility to view and manipulate SBR images
C
1
star
44

tusb926x-flash-burner

TUSB926x modern libusb/hidapi Linux flasher
C++
1
star
45

depthai-node

CMake
1
star
46

rp2040_u2if

Interface with RP2040 running U2IF FW
Python
1
star
47

rae-unity

RAE Unity plugin and Simulation
1
star