Thanks for your interest in contributing to oak-examples! We welcome contributions of all kinds — from bug fixes and small tweaks to full-featured examples demonstrating new or advanced uses of OAK devices.
oak-examples contains a broad collection of demonstrations, tutorials, and application code for running inference, depth measurement, streaming, custom front-ends, integrations, camera control, and more on OAK / DepthAI devices. Generally, each example lives in its own directory, and similar examples are grouped together under higher-level categories (e.g., apps, tutorials, etc.).
The main branch contains examples using DepthAIv3 (and all the new components that come with it), whereas the master branch contains legacy examples built on DepthAIV2.
We follow a standard GitHub workflow: fork the repository, create a new branch for your changes, then submit a pull request. This avoids disrupting stable code and ensures maintainers can review changes before merging.
- Clone the repository locally.
- Consider using the
--depth 1flag to create a lightweight clone, as the full repo is quite large.
Example:git clone --depth 1 --branch main https://github.com/luxonis/oak-examples.git
- Consider using the
- Create a new branch describing your change. Common branch prefixes:
feat/...for new featuresfix/...for fixestest/...for tests
- Install development tools, including pre-commit:
pip install -r requirements-dev.txt
If you are fixing an existing example or file, implement the fix, then proceed to the Testing section.
When adding a new example, first determine the most appropriate location for it. Try to place it under one of the existing top-level categories unless it introduces a fundamentally new category — in that case, propose the category in your PR.
Guidelines for adding a new example to the main branch:
- The example’s directory name should be concise yet descriptive. Use
kebab-caseformatting (e.g.,new-example). - The example should use
DepthAIv3. - Use the
visualizer(a DepthAIv3 component) for visualization unless that is not feasible, in which case you may fall back to OpenCV or another visualization tool. - Each example must include:
requirements.txt— listing all required packages.- We recommend pinning at least
DepthAI(andDepthAI-Nodesif used) to the latest known-working version to avoid breakage from future updates.
- We recommend pinning at least
main.py— the entry point for running the example.
- Each example must include a GIF or a screenshot demonstrating its behavior.
- Store all media in the
/mediafolder. - Keep media size minimal while still effectively demonstrating the example.
- Aim to keep the entire folder size below 10 MB.
- Store all media in the
- Each example must include a
README.mdwith the following general structure (seedefault-appREADME for reference):- Overview — brief description of the example; link to models if used.
- Demo — screenshot(s) or GIF.
- Usage — supported devices, supported modes, and available flags (flags can be auto-generated by
python3 main.py --helpif usingargparse). - Peripheral Mode — installation and usage instructions for peripheral mode (if supported).
- Standalone Mode — instructions for standalone usage (if supported).
- You may deviate from this structure when appropriate, but all relevant information must be included.
Once an example is added, also add an entry to the table in the relevant top-level README (e.g., apps README). Fill in the following columns:
RVC2— Whether the example supports RVC2 devices.RVC4 (peripheral)— Whether it supports RVC4 devices in peripheral mode.RVC4 (standalone)— Whether it supports RVC4 devices in standalone mode.DepthAIv2— Optional link to a DepthAIv2 example the new one is based on.Notes— Optional extra notes (e.g., requires stereo device).
The repository supports automated runnability tests for examples. This ensures that each example can run for several seconds in a controlled environment with its dependencies installed.
To be picked up by the tests, an example must contain both main.py and requirements.txt in the same directory. When detected, the test pipeline will:
- Create a new environment
- Install dependencies from
requirements.txt - Run
python3 main.pywith no additional flags
You can read more about running tests locally in tests/README.md.
Some examples may be incompatible with certain versions or modes (e.g., only standalone, only RVC4). These constraints must be listed in tests/constants.py under the dictionary of known failing examples. See the Known Failing Examples (Rule System) section in tests/README.md for editing guidelines.
Before pushing your changes, ensure that:
- Your changes work in a fresh environment
pre-commitpasses- Tests pass locally
When submitting the PR:
- Provide a clear and concise description of the change.
- For bug reports: include steps to reproduce, environment details, error logs, and device information (e.g., OAK-D, OAK-4).
- Link the related issue if applicable.
- Make sure the PR is focused, atomic, and well-documented.
- Respond to review feedback — maintainers may request adjustments before merging.
- If the PR is not ready for review, mark it as a Draft and list your open questions.
Choose appropriate reviewers:
- If the PR relates to an issue, assign the main issue participant.
- If the PR involves Luxonis developers, add your lead or the relevant team member.
- If unsure, assign
klemen1999 (Klemen Skrlj)who will route the review appropriately.
A PR targeting main must satisfy the CI/CD checks:
- pre-commit must pass
- If it fails, run
pre-commitlocally (see the Setup section), commit the fixes, and push again.
- If it fails, run
- Tests must pass
- Add the
testablelabel to the PR to trigger tests for only the examples modified in the PR.
- Add the