mrousavy / vision-camera-image-labeler

VisionCamera Frame Processor Plugin to label images using MLKit Vision

Home Page:https://github.com/mrousavy/react-native-vision-camera

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: how to initialize ImageLabeling client with different options

rodgomesc opened this issue · comments

i want to initialize the labeler client with different args

private final ImageLabeler labeler = ImageLabeling.getClient(ImageLabelerOptions.DEFAULT_OPTIONS);

but since the plugin uses callback method to receive javascript params, and do that in a frame loop. i don't how to do that,

public Object callback(ImageProxy frame, @NotNull Object[] params) {

can someone walk me through a solution for that?

That's pretty easy to do - you just pass the props you want in the params, and in that callback you just compare if the image labeler is initialized with exactly those params. If not, it should be re-initialized.

If you want, you can add support for this in this library and I'll merge it as a PR :)