This application integrates a DepthAI device with Roboflow Workflow through inference package. The Roboflow Inference package captures frames directly from the DepthAI device, processes them through its detection models, and sends the results to the DepthAI visualizer for real-time viewing. You can change the parameters of the inference pipeline through the interactive UI.
Before running this example, you’ll first need to create your own Roboflow Workflow in the Roboflow web app (documentation).
Once your workflow is ready, populate the initial Roboflow settings in config.yaml.
To retrieve the required values:
- Open your workflow in Roboflow and click
Deploy - Choose
Video->Live Video - Select
Run locally on my server or computer - In the provided code snippet, you’ll find:
workspace_nameworkflow_id
- To get your
api_key, go toSettings->API Keysand copy yourPrivate API Key - The
workflow_parameterscorrespond to the inputs defined on theInputsnode in your workflow.
At runtime, the custom frontend currently supports updating only:
api_keyworkspace_nameworkflow_idworkflow_parameters
Pipeline settings such as device, output_size, and fps still come from config.yaml at startup.
Note: You can update the supported Roboflow values later while the app is running using the custom front-end form. But you still need to start the app with some valid initial values.
Our system applies a few naming-based rules to determine how workflow outputs are visualized. Keep the following guidelines in mind:
Outputs whose names include the substring predictions are treated as DepthAI detection messages. Only the bounding box information is processed; any additional fields in the Roboflow Detection message will be ignored.
If your workflow produces a Roboflow Detection message, ensure its output name includes predictions so it can be detected and parsed correctly.
Outputs whose names include the substring visualization are interpreted as DepthAI ImgFrame messages.
If your workflow produces Roboflow WorkflowImageData, include visualization in the output name so we can display it properly.
Outputs whose names do not contain either predictions or visualization are ignored by the visualizer.
For richer or customized visual outputs, consider:
- Adding
Visualizationblocks directly inside your workflow and ensuring the resulting output name containsvisualization. - Extending the AnnotationNode with custom logic tailored to your data type.
Running the example in the standalone mode, app runs entirely on the device.
To run the example in this mode, first install the oakctl tool using the installation instructions here.
The app can then be run with:
oakctl connect <DEVICE_IP>
oakctl app run .Once the app is built and running you can access the DepthAI Viewer locally by opening https://<OAK4_IP>:9000/ in your browser (the exact URL will be shown in the terminal output).
Note: This is running with python3.11 because of the zxing-cpp package (part of the inference package dependencies) which is not available for python3.12
