{"repo":"mrousavy/vision-camera-resize-plugin","free":true,"listed":false,"github":"https://github.com/mrousavy/vision-camera-resize-plugin","clone":"git clone https://github.com/mrousavy/vision-camera-resize-plugin.git","description":"A VisionCamera Frame Processor plugin for fast buffer resizing and colorspace (YUV <> RGBA) conversions","language":"Objective-C++","stars":130,"topics":["buffer","camera","conversion","convert","react-native","react-native-vision-camera","resize","rgb","tensorflow","tflite"],"license":"MIT","category":"machine-learning","readme_excerpt":"vision-camera-resize-plugin A VisionCamera Frame Processor Plugin for fast and efficient Frame resizing, cropping and pixel-format conversion (YUV - RGB) using GPU-acceleration, CPU-vector based operations and ARM NEON SIMD acceleration. Installation 1. Install react-native-vision-camera ( = 3.8.2) and react-native-worklets-core ( = 0.2.4) and make sure Frame Processors are enabled. 2. Install vision-camera-resize-plugin: Usage Use the resize plugin within a Frame Processor: Or outside of a function component: Pixel Formats The resize plugin operates in RGB colorspace. Name 0 1 2 3 rgb R G B R rgba R G B A argb A R G B bgra B G R A bgr B G R B abgr A B G R Data Types The resize plugin can either convert to uint8 or float32 values: Name JS Type Value Range Example size uint8 Uint8Array 0...255 1920x1080 RGB Frame = 6.2 MB float32 Float32Array 0.0...1.0 1920x1080 RGB Frame = 24.8 MB Cropping When scaling to a different size (e.g. 1920x1080 - 100x100), the Resize Plugin performs a center-crop on the image before scaling it down so the resulting image matches the target aspect ratio instead of being stretched. You can customize this by passing a custom crop parameter, e.g. instead of center-crop, use the top portion of the screen: Performance If possible, use one of these two formats: - argb in uint8 : Can be converted the fastest, but has an additional unused alpha channel. - rgb in uint8 : Requires one more conversion step from argb , but uses 25% less memory due to the removed","default_branch":null,"files":null,"tree":[],"storefront":"/r/mrousavy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mrousavy/vision-camera-resize-plugin/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}