Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ frames or not send to the flask server using axios #2617

Closed
2 tasks done
niazikhan001 opened this issue Feb 29, 2024 · 0 comments
Closed
2 tasks done

✨ frames or not send to the flask server using axios #2617

niazikhan001 opened this issue Feb 29, 2024 · 0 comments
Labels
✨ feature Proposes a new feature or enhancement

Comments

@niazikhan001
Copy link

What feature or enhancement are you suggesting?

const sendFrameToBackend = Worklets.createRunInJsFn(async (frame) => {
console.log(Running inference on ${frame});
try {

  const response = await axios.post('http://192.168.1.3:5000/predict', {
    frame ,
  });
  console.log('Frame sent successfully:', response.data);
} catch (error) {
  console.error('Error sending frame to backend:', error);
}

})

const frameProcessor = useFrameProcessor((frame) => {
'worklet'
// console.log(Frame: ${frame.width}x${frame.height} (${frame.pixelFormat}))
// console.log(Running inference on ${frame});

// Send the frame to the backend when captured
sendFrameToBackend(frame)
})

**errors are**

 ERROR  Error sending frame to backend: [Error: Exception in HostObject::getPropertyNames: com.mrousavy.camera.core.FrameInvalidError: [capture/frame-invalid] Trying to access an already closed Frame! Are you trying to access the Image data outside of a Frame Processor's lifetime?
  • If you want to use console.log(frame), use console.log(frame.toString()) instead.
  • If you want to do async processing, use runAsync(...) instead.
  • If you want to use runOnJS, increment it's ref-count: frame.incrementRefCount()]

What Platforms whould this feature/enhancement affect?

Android

Alternatives/Workarounds

no alternative way

Additional information

@niazikhan001 niazikhan001 added the ✨ feature Proposes a new feature or enhancement label Feb 29, 2024
@mrousavy mrousavy closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature Proposes a new feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants