#7723·onnx

[Feature request] External Texture importer for iOS/Android (`CVPixelBuffer`/`AHardwareBuffer*`, or Metal/OpenGL Buffer)

Author: mrousavyCreated Mar 9, 2026Updated Sep 13, 2026
Labelstopic: enhancementtopic: preprocessing

System information

1.20.1

What is the problem that this feature solves?

It would be great to provide an API to import external textures/buffers on iOS and Android too, to avoid any expensive CPU <-> GPU copies/syncs and provide better performance for realtime (Camera) workflows.

Alternatives considered

CPU download (void*)

Describe the feature

On iOS, we could support either (or both);

  • CVPixelBuffer: A handle to a Core Video pixel buffer (shared GPU/CPU memory) - this is what the Camera produces. I don't think this is a great fit for ONNX, as this is not preprocessed (resized, converted) at all, so I don't see a lot of use-cases for this.
  • MTLBuffer: A Metal Buffer that stores data on the GPU - this is what I currently use as a target for my preprocessing pipeline - I resize & convert my Camera Frame into an MTLBuffer.

On Android, we could support either (or both);

  • AHardwareBuffer*: A handle to an Android HardwareBuffer (shared GPU/CPU memory) - this is what the Camera produces. I don't think this is a great fit for ONNX, as this is not preprocessed (resized, converted) at all, so I don't see a lot of use-cases for this.
  • GL_PIXEL_PACK_BUFFER (GLuint): A handle to a PBO that stores the data - I resize & convert my Camera Frame into an OpenGL PBO.

Will this influence the current api (Y/N)?

It will add a new function, possibly using the existing importer API (which as far as I can see is only for Windows for now?)

Feature Area

data preprocessing / input tensors

Are you willing to contribute it (Y/N)

Yes

Notes

No response