Giter Site home page Giter Site logo

Comments (5)

nonam4 avatar nonam4 commented on June 14, 2024

I suppose you’re using my recommended way, am I right? If this the case you need to use default vision camera docs way then

from react-native-vision-camera-face-detector.

nonam4 avatar nonam4 commented on June 14, 2024

Or you can call some frame internal method. I don’t remember right now what exactly but it’s something like increseRef. But you will need to cast frame as internalFrame type

from react-native-vision-camera-face-detector.

felire avatar felire commented on June 14, 2024

I resolved this by disabling the originalFrame prop, and returning the result on the detectFaces instead of executing the callback. By doing that I was able to use rhe result data on the frame for other operations, this worked fine on android I haven't tested it on ios.
In my opinion I thini returning the result instead of the callback would be a better spproach for the plugin, what is the advantage that you have by using the callback?

from react-native-vision-camera-face-detector.

nonam4 avatar nonam4 commented on June 14, 2024

@felire can you provide an example code of your sollution? So other people with same issue can test it too.

About "returning result instead..." I'd appreciate it if you could open a PR with your ideas 😁

from react-native-vision-camera-face-detector.

frodriguez-hu avatar frodriguez-hu commented on June 14, 2024

I just did this @nonam4 :

export function detectFaces(
  frame: Frame,
  callback: CallbackType,
  options?: FaceDetectionOptions
) {
  'worklet'
  if ( !plugin ) {
    throw new Error( 'Failed to load Frame Processor Plugin "detectFaces"!' )
  }
  // @ts-ignore
  const result: DetectionResult = plugin.call( frame, options )
  callback( result )
  return result;
}

Returning the result and using it instead of using the callback

from react-native-vision-camera-face-detector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.