question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to capture a photo with a Tensorflow Camera in React native?

See original GitHub issue

TensorFlow.js version

"@tensorflow/tfjs": "^1.5.2",
"@tensorflow/tfjs-react-native": "^0.2.3",

Browser version

"expo": "^37.0.0",
Platform: Android 10
Device: One Plus 8

Describe the problem or feature request

I have a Tensorflow Camera component where I’m running a model every n frames using the onReady = {this.handleCameraStream} type workflow shown in the tensorflow Camera documentation.

I’d like to save a frame of the camera stream as a JPEG depending on the result of the model. Does anybody know the easiest way to do this?

I’ve tried using Expo-Camera’s takePictureAsync function but found that it stops working when you wrap the camera with the cameraWithTensors

Any help would be appreciated!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Cannonball2134commented, Jun 30, 2021

Any luck figuring out the image quality issue @JJwilkin ?

1reaction
JJwilkincommented, Feb 25, 2021

@tafsiri Hi, thanks for addressing this issue, as I was running into as well. I was working to access the live frames as jpg for OCR purposes, but after decode the tensor into a jpg, found the image quality to be dramatically reduced. My partner had created a stack overflow question detailing this: https://stackoverflow.com/questions/66357352/tensor-to-jpeg-improve-quality

Read more comments on GitHub >

github_iconTop Results From Across the Web

Real Time Image Classification with TensorFlow and React ...
In this tutorial we will implement a simple mobile app that acts as a pictionary (picture dictionary) for a specific language by using...
Read more >
How to use Tensorflow image processing with React Native
Link to the GitHub repo:https://github.com/ajdinahmetovic/ShapeRecognition-App.
Read more >
Image Classification on React Native with TensorFlow.js and ...
In this tutorial, we're going to explore TensorFlow.js and the MobileNet pre-trained model architecture to classify input images in a React Native mobile ......
Read more >
Real-Time Object Detection Using TensorFlow In React Native
This article has provided all the steps of how to get real-time object detection using TensorFlow in react native application on the videos ......
Read more >
Image Classification on React Native ... - DEV Community ‍ ‍
The application will require the user to upload an image from their phone's camera roll or gallery. You have to add a handler...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found