This example shows how you can use multiple DepthAI's on a single host. The demo will find all devices connected to the host and display an RGB preview from each of them. Preview size will depend on the device type - if device has mono cameras, the rgb preview will be 600x300
, otherwise it will be 300x300
. In other words, pipeline that will get uploaded to the device will depend on the device model (OAK-1/OAK-D).
Just two OAK cameras looking at each other.
Program will also print USB speed, model type and connected cameras for each connected device before starting the pipeline. Output example for having connected an OAK-1 on USB2, OAK-D on USB3, OAK-1-POE and OAK-D-POE:
Found 4 devices
=== Connected to 14442C10016B5ED700
>>> MXID: 14442C10016B5ED700
>>> Cameras: RGB LEFT RIGHT
>>> USB speed: SUPER
>>> Loading pipeline for: OAK-D
=== Connected to 14442C10D197AACE00
>>> MXID: 14442C10D197AACE00
>>> Cameras: RGB
>>> USB speed: HIGH
>>> Loading pipeline for: OAK-1
[192.168.1.23] [29.087] [system] [warning] Calibration Data on device is empty
=== Connected to 192.168.1.23
>>> MXID: 14442C1031A3A7D200
>>> Cameras: RGB LEFT RIGHT
>>> USB speed: UNKNOWN
>>> Loading pipeline for: OAK-D-POE
=== Connected to 192.168.1.27
>>> MXID: 14442C1041D0A7D200
>>> Cameras: RGB
>>> USB speed: UNKNOWN
>>> Loading pipeline for: OAK-1-POE
Script multi-device-mobilenet.py
will run mobilenet-ssd
single shot object detector on all devices and display detections on frames.
If you would want to display detections on high-res frames (not 300x300), check tutorial here.
The multi-device-mjpeg-decoding.py script will connect to multiple devices and stream encoded 4K JPEG frames from all devices to the host. On host computer we run a thread for each device, boot the device, get frames, decode them, and put them in a queue which the main thread reads and displays the frame on the main thread.
python3 -m pip -U pip
python3 -m pip install -r requirements.txt
python3 main.py