Skip to content

Add support for vkapriltag #2588

Description

@yojobama

Is your feature request related to a problem? Please describe.

PhotonVision currently relies on CPU-based libapriltag for AprilTag detection. On ARM-based embedded coprocessors without CUDA support (such as the Orange Pi 5 / RK3588 Mali GPU), CPU-bound detection heavily limits frame rates and consumes CPU headroom needed for other vision pipelines. Existing GPU detectors are almost exclusively CUDA-dependent or inefficient on non-NVIDIA hardware.

Describe the solution you'd like

Add an optional Vulkan-accelerated backend (vkapriltag) for AprilTag detection alongside libapriltag. The settings UI would ideally support:

  • A toggle to select between CPU (libapriltag) and Vulkan GPU (vkapriltag).
  • A device selector dropdown to choose the active Vulkan compute device when multiple GPUs/devices are present.
  • Graceful fallback to CPU libapriltag if Vulkan 1.1+ initialization fails.

Describe alternatives you've considered

  • cuAprilTags / CUDA detectors: Incompatible with ARM Mali GPUs on non-NVIDIA single-board computers like the Orange Pi 5.
  • Standard CPU detection: High CPU usage and limited FPS scaling at higher camera resolutions.

To solve this, I created vkapriltag, a custom Vulkan 1.1+ compute detector. On my personal Orange Pi 5 plus, offloading detection to the GPU educed CPU load and improved latency to ~16.1ms at 1920*1080.

Additional context

  • Repository: https://github.com/yojobama/vkapriltag
  • Requirements: Vulkan 1.1+ driver support.
  • Build Integration: CMake-compatible C/C++ library designed for straightforward native linking.
  • Contribution: I can assist with C++ native integration, benchmarking, and testing on RK3588 hardware.

i.e: it requires vulkan drivers to be installed, that means adding the appropriate drivers to every image file (like libmali) if they're not already installed.

a test run on my system (ryzen 5600x, rx 9060 xt 16gb, 64gb ram)
Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions