tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

[RN] Pose Detection not working on android.

Open GwangjoGong opened this issue 4 years ago • 9 comments

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): Yes. I referred to the pose detection example.
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS Monterey 12.0.1
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: Samsung Galaxy S10 5G
  • TensorFlow.js installed from (npm or script link): npm
  • TensorFlow.js version (use command below): ^0.8.0
  • Browser version: Chrome 96.0
  • Tensorflow.js Converter Version: ^3.11.0
  • Expo version : 43.0.0

Describe the current behavior Pose estimation not working properly only on Android. (keypoints are detected, but very low score)

There was no error during preparation (load model, handleImageTensorReady). Also, camera preview works properly.

Describe the expected behavior Pose estimation should work same as IOS.

Standalone code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab/CodePen/any notebook.

Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

package.json
"@tensorflow-models/pose-detection": "^0.0.6",
"@tensorflow/tfjs": "^3.11.0",
"@tensorflow/tfjs-react-native": "^0.8.0",
"expo": "~43.0.0",
"expo-camera": "~12.0.3",
"expo-file-system": "~13.0.3",
"expo-gl": "~11.0.3",
"expo-gl-cpp": "~11.0.1",

GwangjoGong avatar Dec 27 '21 10:12 GwangjoGong

Did you get chance to check the working example provided here https://github.com/tensorflow/tfjs-examples/tree/master/react-native/pose-detection ?

rthadur avatar Dec 28 '21 19:12 rthadur

@rthadur I tested the working example on both OS, but neither worked. (Galaxy S10 5G, iPhone 11 Pro)

Result IOS : app crashed after warning: initialization of backend rn-webgl failed Android : only black screen displayed.(both front/back camera) frame rate was about 4~5fps.

Test Process

  1. clone repo
  2. yarn && yarn start
  3. Scan QR code and launch app with Expo Go

GwangjoGong avatar Dec 29 '21 03:12 GwangjoGong

I can confirm the same behaviour as @GwangjoGong using the examples https://github.com/tensorflow/tfjs-examples/tree/master/react-native/pose-detection on a Pixel 4a and a iPhone 8, namely, the iPhone crashed and the Android renders a blank black screen.

steswinbank avatar Dec 29 '21 21:12 steswinbank

Hi,

This is likely to be caused by incompatible expo-gl and expo-gl-cpp. Please double check the version combination mentioned here. Any higher version of expo-gl and expo-gl-cpp might cause crash.

If the app doesn't work directly from the cloned repo, that might indicate some other problems.. I will need to borrow a pixel 4 somewhere for further testing:)

jinjingforever avatar Jan 05 '22 00:01 jinjingforever

I had the same problem as @GwangjoGong using the example with a Galaxy A52s. When testing on a Iphone 12, the application just crashed.

GRenkel avatar Jan 07 '22 20:01 GRenkel

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you.

google-ml-butler[bot] avatar Jan 14 '22 20:01 google-ml-butler[bot]

related PR has been merged , closing this issue. Feel free to @mention to reopen if the issue still exists. Thank you

rthadur avatar Jan 14 '22 23:01 rthadur

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Jan 14 '22 23:01 google-ml-butler[bot]

@rthadur @jinjingforever Thank you for the update. I've tested the example on Samsung Galaxy S10, but the example still not working properly.

Expected behavior keypoints should be displayed just like the image on the README.md

Actual behavior App does not crashed, but the keypoints(green circles) not displayed properly. (only 1-2 circles shown randomly)

Test Process

  1. clone repo
  2. yarn => Failed with error An unexpected error occurred: "https://registry.yarnpkg.com/colors/-/colors-1.4.2.tgz: Request failed \"404 Not Found\"".
  3. rm yarn.lock
  4. yarn && yarn start
  5. set camera to front and adjust position to show my face and shoulder. (just like image on README.md)

GwangjoGong avatar Jan 26 '22 09:01 GwangjoGong