Getting Started with the DepthAI API Demo Program

Mar 7, 2021 | Educational

The DepthAI API demo program allows you to explore various functionalities of the DepthAI platform, enabling the loading of different neural networks, creating pipelines, recording videos, and much more. This guide will walk you through everything you need to know to get started, including troubleshooting tips.

Installation

Follow these steps to install the DepthAI demo application on your system:

  • Clone the Repository: Start by cloning the DepthAI repository using the command:
  • git clone --recursive https://github.com/luxonis/depthai.git
  • Update Submodules: If you have already cloned the repository, you can update your submodules with:
  • git pull --recurse-submodules
  • One-time Installation: Run the following command to install the necessary packages:
  • sudo curl -fL https://docs.luxonis.com/install_dependencies.sh | bash
  • Python Dependencies Installation: After cloning, ensure that your Python interpreter has all required packages installed by running:
  • python3 install_requirements.py

Using Docker

You can also run DepthAI programs via Docker. Here’s how:

  • DepthAI Demo:
  • docker run --privileged -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule=c 189:* -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:* -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --network host --rm -i -t luxonis/depthai:latest python3 depthai_calibrate.py [parameters]

How to Use the DepthAI Demo

The demo can be used through the command line or the QT GUI. To run a command from your terminal, you can leverage various arguments:

  • Command Line 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
    python3 depthai_demo.py -gt cv -cnn tiny-yolo-v3 -sh 8 - Run tiny-yolo-v3 model and compile for 8 shaves

Understanding the Code with an Analogy

Think of the DepthAI API demo program as an advanced Swiss Army knife for developers working with AI features. Each tool (or command) within the program offers a different function, from camera integration (like the UVC app) to video recording capabilities. You can easily switch between tools just as you would with your knife: pulling out the video recording tool when you need it, or the AI model evaluation when you’re testing a machine learning model.

Troubleshooting Tips

If you run into any issues while using the DepthAI API demo program, don’t worry! Here are some troubleshooting ideas:

  • Ensure that all dependencies have been installed correctly by following the installation instructions again.
  • If you’re experiencing issues with Docker, confirm your Docker environment settings are correctly set for X11 access.
  • To report any persistent issues, gather necessary system information using the command log_system_information.sh and share it via email.
  • If you encounter any error messages, take a screenshot or write them down as they can be helpful for diagnosing the problem.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox