GithubHelp home page GithubHelp logo

Comments (13)

mfkrause avatar mfkrause commented on June 4, 2024 1

This only seems to happen when using runAsync. If I use runAtTargetFps (tested with 15 FPS for now), it works seamlessly.

from react-native-vision-camera.

bglgwyng avatar bglgwyng commented on June 4, 2024 1

I made a minimal reproducer.

const frameProcessor = useFrameProcessor((frame) => {
  'worklet'

  runAsync(frame, () => {
    'worklet'
    foo(frame)

    console.info('run frame processor')
  })
}, [])

And the definition of foo should be

const foo = (frame: Frame) => {
  'worklet'
  frame.height
}

When foo doesn't include any access to frame's property(height here), the frame processor doesn't stop.

from react-native-vision-camera.

luicfrr avatar luicfrr commented on June 4, 2024 1

@mrousavy I messed up with issues I'm subscribed πŸ˜… this don't have anything to do with worklets-core. Sorry.

But anyway, what solved this "freeze" issue for me was incrementing frame ref count before doing anything else with frame. Ex:

const faces = detectFaces( frame )
const internal = frame as FrameInternal
// incremend frame ref before doing any task with frame
internal.incrementRefCount()
runOnJs(
  faces,
  frame
).finally( () => {
  'worklet'
  // decrement frame ref after all tasks
  internal.decrementRefCount()
} )

@bglgwyng Hope this helps

from react-native-vision-camera.

mrousavy avatar mrousavy commented on June 4, 2024 1

I fixed this issue in my latest PR to main.
Ref counting now works properly on iOS as well

from react-native-vision-camera.

luicfrr avatar luicfrr commented on June 4, 2024

@mfkrause Hey, you're using my face detection package, glad it's helping you 😁

I had the same problem and as a workaround I added frame data inside detection result data, so instead of using frame.height try using result.frame.height.

For me this works.

The most strange thing is that on androi it works, you can use frame data directly without any issue but on IOS it freezes after some frames

from react-native-vision-camera.

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

Check this, get the result and operate on the current processor and not on the callback

luicfrr/react-native-vision-camera-face-detector#28

from react-native-vision-camera.

mrousavy avatar mrousavy commented on June 4, 2024

Hey - I think this issue has been fixed in VisionCamera 4.0.0. πŸ₯³

Please try V4 and let me know if you still experience this issue;

  • if not, please consider πŸ’– sponsoring me on GitHub πŸ’– to support the development of VisionCamera and thank me for my time spent on fixing bugs and building new features.
  • if you still see this issue, please comment and we can re-open this. But please update your native logs with the native (Xcode/Android Studio) logs from running VisionCamera V4 so I can investigate this.

from react-native-vision-camera.

mrousavy avatar mrousavy commented on June 4, 2024

more accurately; react-native-worklets-core 1.x.x fixed this issue I think.

from react-native-vision-camera.

bglgwyng avatar bglgwyng commented on June 4, 2024

I think we need to reopen this issue.
I still observe the same behavior with [email protected] and [email protected].

from react-native-vision-camera.

mrousavy avatar mrousavy commented on June 4, 2024

Ah shit. Well can we create a new issue with logs from latest react-native-vision-camera and rnwc then?

from react-native-vision-camera.

luicfrr avatar luicfrr commented on June 4, 2024

@mrousavy I created a new issue on worklets-core repo with all logs from latest versions

from react-native-vision-camera.

mrousavy avatar mrousavy commented on June 4, 2024

Great, thanks

from react-native-vision-camera.

bglgwyng avatar bglgwyng commented on June 4, 2024

Thanks! But isn't it a workaround? runAsync internally increases/decreases the ref count. Should we perform this redundant operation?

from react-native-vision-camera.

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.