PoseNet model in realtime, modified from with-tfjs-camera
Identify poses with @tensorflow/tfjs
, expo-camera
, and expo-gl
(for native acceleration).
npx create-react-native-app my-app -t with-tfjs-camera
cd my-app
- Run
expo start
, open on a native device (simulator, emulator, and browser are not supported).
npm i @tensorflow-models/posenet
git clone https://github.com/jude253/posenet-react-native
6. copy the files ModelView.js
and PredictionList.js
from posenet-react-native/src
to my-app/src
and overwrite the files in my-app/src
cd my-app
- Run
expo start
, open on a native device (simulator, emulator, and browser are not supported).
- hit
control + c
in terminal
-
in the directory
my-app
run commandexpo eject
and enter in the expo-free app and package names -
to run the app now, use
npm run web
or some variant ofnpm run
-
You can swap out
@tensorflow-models/posenet
for another TensorFlow model to achieve different results.
-
the number at the bottom of the camera UI is the confince the posenetmodel has in its predictions
-
the prediction output of the model is logged to the console.
-
the predictions are generated in
ModelView.js
-
PredictionList.js
is where the predictions are turned into a UI element.