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:
onModelProcessed
is a JS callback that will receive the output of processing each frame.- You can pass in a
modelParams
prop to control the pose detection. This is backed byCameraViewManager.setModelParams
, which invokessetModelParams
onRNCameraView
RNCameraView.setModelParams
sets up aTFliteModel
(defined in react-native-pose-decoding) to instantiate a TFliteInterpreter
. The.tflite
model file is expected to be in theassets/
folder.onFramePreview
will then start an asynchronousModelProcessorAsyncTask
for each frame, and pass to it a correctly rotated bitmap to process.ModelProcessorAsyncTask
delegates most of its work to react-native-pose-decoding’sDecoder
. The result of pose detection is a list ofPose
objects which are serialized viaModelProcessedEvent
back to JS.