A VisionCamera Frame Processor plugin for fast buffer resizing

Overview

vision-camera-resize-plugin

A VisionCamera Frame Processor Plugin for fast buffer resizing.

By resizing buffers to a smaller resolution, you can achieve much faster frame processor executions than by running AI on a full-sized (4k) buffer.

Installation

npm install vision-camera-resize-plugin
cd ios && pod install

Add the plugin to your babel.config.js:

module.exports = {
  plugins: [
    [
      'react-native-reanimated/plugin',
      {
        globals: ['__resize'],
      },
    ],

    // ...

Note: You have to restart metro-bundler for changes in the babel.config.js file to take effect.

Usage

{ 'worklet'; if (frame.width > 1920) { frame = resize(frame, 1920, 1080) } // run AI on smaller buffer here }, []); ">
import { resize } from "vision-camera-resize-plugin";

// ...

const frameProcessor = useFrameProcessor((frame) => {
  'worklet';
  if (frame.width > 1920) {
    frame = resize(frame, 1920, 1080)
  }
  // run AI on smaller buffer here
}, []);

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

You might also like...
1D, 2D, and 3D variations of Fast Fourier Transforms for a Metal S4TF backend

MetalFFT MetalFFT is an experiment in adding GPU acceleration for 1D, 2D, and 3D variations of Fast Fourier Transforms. This framework's original purp

API surface for Swift plug-ins using the Swift Plugin Manager

SwiftPlugin The minimal API surface required for the Swift Plugin Manager to create instances from a loaded plugin. Additional documentation and refer

Cordova plugin to display a native color-picker dialog

Color Picker Plugin for Cordova (cordova-plugin-color-picker) Description This plugin allows you to display a color-picker native dialog in iOS and An

Metazoom - A virtual camera plugin to pixellatedly share your screen

MetaZoom A virtual camera plugin to pixellatedly share your screen. See LICENSE.

Flutter openvpn - A new Flutter plugin that uses OpenVpn

flutter_openvpn A new Flutter plugin that uses OpenVpn. Installation Depend on i

PerFolderResourcesPublishPlugin - Per-folder resources plugin for the Publish package

Per-folder resources for Publish A Publish plugin that copies per-folder resourc

Xcode plugin that moves the instruction pointer to the selected line
Xcode plugin that moves the instruction pointer to the selected line

SFJumpToLine Xcode plugin that moves the instruction pointer to the selected line. Install: Install via Alcatraz Or clone and build the project, then

Touch ID Plugin (Cordova) for iOS

cordova-plugin-gctouch-id Touch ID Plugin (Cordova) for iOS Author: Giulio Caruso aka rdn Index Description Technical Documentation Screenshots Adding

Xcode plugin that brings ⇧⌘T from AppCode over to Xcode

Aviator An Xcode Plugin that brings ⇧⌘T over to Xcode This minimal plugin allows you to use the key combo ⇧⌘T to toggle between source and test files.

Comments
  • Implicit conversion of Objective-C pointer type 'Frame *' to C pointer type 'CMSampleBufferRef'

    Implicit conversion of Objective-C pointer type 'Frame *' to C pointer type 'CMSampleBufferRef'

    Hey,

    that's exactly the plugin I'd need right now, but it looks like it's not really ready to use (like: at all) 😅

    I get an error

    Implicit conversion of Objective-C pointer type 'Frame *' to C pointer type 'CMSampleBufferRef' 
    aka 'struct opaqueCMSampleBuffer *') requires a bridged cast
    

    in line 27 and line 30 when I try to create a build in xcode

    Also, as somebody else pointed out already: the JS part of this plugin is still the labelImage function. Any chance to get this fixed on the short term? 🙂

    opened by manuelbieh 0
Owner
Marc Rousavy
they call me ranch cause I be dressing
Marc Rousavy
Xcode-streamdeck-plugin - A Stream Deck plugin for Xcode

Stream Deck Xcode Plugin This repository contains a Stream Deck plugin to add so

Daniel Kennett 77 Dec 27, 2022
Cordova-plugin-saveimage - This plugin helps you save images

cordova-plugin-saveimage This plugin helps you save images on iOS/Android Instal

Bernat 2 May 11, 2022
A lightweight and fast image loader for iOS written in Swift.

ImageLoader ImageLoader is an instrument for asynchronous image loading written in Swift. It is a lightweight and fast image loader for iOS. Features

Hirohisa Kawasaki 293 Nov 24, 2022
🍁🥓 Lightweight and fast Swift library for image downloading, caching and transformations

MapleBacon Introduction MapleBacon is a lightweight and fast Swift library for downloading and caching images. Example The folder Example contains a s

Jan Gorman 335 Nov 1, 2022
Fast and simple OCR library written in Swift

⛔️ This Project is deprecated and no longer gets maintained! Please use Apple's Vision framework instead of SwiftOCR. It is very fast, accurate and mu

Nicolas Camenisch 4.5k Dec 29, 2022
A Fast and Complete Swift Drawing Library

FastDraw A Fast and Complete Swift Drawing Library Description FastDraw is a high performance and highly extensible Drawing Library that supports Appl

Collin Zhang 18 Nov 14, 2022
This simple cordova plugin will download picture from an URL and save to IOS Photo Gallery.

Photo Viewer This plugin is intended to download a picture from an URL into IOS Photo library.. How to Install Cordova: cordova plugin add https://git

Alwin jose 1 Oct 23, 2021
Cordova plugin for detect screenshots and recordings

cordova-plugin-detect-screen-capture This plugin detects screen recording and screenshot events. The plugin will only work on devices with iOS >= 7 Su

Sasha 0 Nov 4, 2021
Fast and simple OCR library written in Swift

⛔️ This Project is deprecated and no longer gets maintained! Please use Apple's Vision framework instead of SwiftOCR. It is very fast, accurate and mu

Nicolas Camenisch 4.5k Dec 29, 2022
1D, 2D, and 3D variations of Fast Fourier Transforms for a Metal S4TF backend

MetalFFT MetalFFT is an experiment in adding GPU acceleration for 1D, 2D, and 3D variations of Fast Fourier Transforms. This framework's original purp

Philip Turner 21 Oct 11, 2022