This is a fork of the react-native-camera library, modified to allow native pose detection on the preview stream (since passing image frames back to JS over the bridge is too slow).
Most of the changes follow the patterns already implemented for face detection.
Concretely:
onModelProcessedis a JS callback that will receive the output of processing each frame.- You can pass in a
modelParamsprop to control the pose detection. This is backed byCameraViewManager.setModelParams, which invokessetModelParamsonRNCameraView RNCameraView.setModelParamssets up aTFliteModel(defined in react-native-pose-decoding) to instantiate a TFliteInterpreter. The.tflitemodel file is expected to be in theassets/folder.onFramePreviewwill then start an asynchronousModelProcessorAsyncTaskfor each frame, and pass to it a correctly rotated bitmap to process.ModelProcessorAsyncTaskdelegates most of its work to react-native-pose-decoding’sDecoder. The result of pose detection is a list ofPoseobjects which are serialized viaModelProcessedEventback to JS.