react-native-vision-camera-realtime
БесплатноБез исполняемых скриптовНе проверенDesign and review production-grade low-latency VisionCamera v5 pipelines. Use for real-time GPU, ML, CV, Skia or WebGPU overlays, Nitro frame plugins…
от margelo★ 185 звёзд на GitHubОб этом скилле
Real-time VisionCamera pipelines
This is the specialized companion to react-native-vision-camera. Optimize the complete path from Camera buffer to final result, not an isolated stage. Before relying on exact APIs, check installed versions against current VisionCamera docs and the consumer's official docs or source.
Choose by final consumer
| Final consumer | Preferred path |
|---|---|
| Frame-coupled rendering, effects, or overlays | Keep processing and drawing on one GPU timeline with <SkiaCamera /> or WebGPU |
| WGSL compute or GPU inference | Frame.getNativeBuffer() to a WebGPU video frame to device.importExternalTexture(...) |
| Native plugin that depends on VisionCamera | A long-lived Nitro HybridObject whose hot method accepts a typed Frame |
| Native library without a VisionCamera dependency | The untyped NativeBuffer pointer and explicit release contract |
| State-only ML or scanning | Benchmark the platform runtime across ANE or NPU, GPU, and CPU backends; return compact state |
| CPU-only consumer | Use the smallest useful resolution and format with a bounded, reusable CPU buffer path |
Load references/interop.md only when implementing or reviewing Nitro, NativeBuffer, WebGPU, Skia, Resizer, or ArrayBuffer interop.
Hot-path invariants
- Keep orientation and mirroring as metadata. Set
enablePhysicalBufferRotation: false, then passframe.orientationandframe.isMirroredto the consumer or apply them in the same GPU transform that scales, crops, or renders. Never rotate the Camera buffer physically. - Stay in one execution and memory domain. In a GPU pipeline, import once, keep preprocessing, inference, postprocessing, and rendering on the GPU, and read back only a compact result when required.
- Prefer
pixelFormat: 'native'for a verified GPU-only path. Checkframe.pixelFormatandframe.hasNativeBufferbecause the resolved native format may be YUV, RGB, RAW, or private. - Do not use
getPixelBuffer(),getPlanes(), plane pixel buffers, mapped GPU buffers, or typed pixel views in the normal GPU path. CPU visibility can force synchronization or download. - Create and warm pipelines, shaders, samplers, model sessions, resizers, large buffers, and native processors once. Reuse them for the component or session lifetime; never allocate them per frame.
- Draw frame-coupled overlays from the same
Framewith Skia or WebGPU. Do not route per-frame geometry through React state, ordinary views, or Reanimated shared values. - Release every
Frame,NativeBuffer, wrapper, texture, and pooled slot exactly once on every path. Release wrappers in reverse ownership order and dispose theFramelast.
Prefer same-frame processing
Keep detection, tracking, decisions, and drawing synchronous with the matching frame when they must align visually. At 60 FPS the hard interval is 16.67 ms; at 30 FPS it is 33.33 ms. Target under roughly 16 ms and 33 ms to leave scheduling margin.
"Synchronous" means same-frame dataflow, not blocking the CPU until the GPU finishes. Encode dependent GPU stages in one command graph when possible. Do not add per-frame queue.onSubmittedWorkDone(), buffer mapping, readback, or another CPU or GPU fence.
Before making work asynchronous, remove copies and readbacks, reduce input resolution or FPS, fuse passes, optimize model tensors, and reuse warmed state. Use async only when the optimized work still cannot fit the frame interval, often around 50 ms or more, and the product accepts stale results. For frame-coupled visuals, prefer simplifying the work over visible lag.
The async delivery patterns are peers:
- native Nitro work with a retained completion callback
- native Nitro work that stores completed state behind a synchronous latest-state getter
- a synchronous native method scheduled with VisionCamera's
useAsyncRunner()
Every async design must bound in-flight work. Use one active task or a small fixed pool, reject or replace stale pending input, and never build an unbounded FIFO queue. dropFramesWhileBusy is an overload guard, not the architecture. With useAsyncRunner(), dispose an accepted Frame inside the task and a rejected Frame immediately.
Choose ML compute end to end
If inference feeds a same-frame Skia or WebGPU render, prefer keeping the entire path on the GPU. Crossing to an ANE, NPU, or CPU and returning geometry to the renderer is worthwhile only when end-to-end profiling proves it is faster while preserving the frame budget.
For state-only scanning, benchmark the platform runtime's available compute units. An ANE or NPU can avoid GPU contention and accelerate supported models; a CPU can win for tiny models when accelerator dispatch and transfer cost dominates. Measure input conversion, synchronization, inference, and result delivery, not inference alone. Normal React state or navigation is fine after a scan that has no frame-coupled
Установить react-native-vision-camera-realtime в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл react-native-vision-camera-realtime?
Design and review production-grade low-latency VisionCamera v5 pipelines. Use for real-time GPU, ML, CV, Skia or WebGPU overlays, Nitro frame plugins, zero-copy interop, frame budgets, and latency profiling. Use the general react-native-vision-camera skill for setup, capture, controls, basic frame outputs, or v4 migration.
Как установить скилл react-native-vision-camera-realtime?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл react-native-vision-camera-realtime запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic