Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 908 Bytes

File metadata and controls

31 lines (26 loc) · 908 Bytes

@pose-tracker/pose-estimation-web-react

Thin React wrapper over @pose-tracker/pose-estimation-web. Mirrors RN light naming: PoseTrackerProvider, PoseCamera, usePoseTracker.

npm install @pose-tracker/pose-estimation-web-react @pose-tracker/pose-estimation-web @tensorflow/tfjs
import {
  PoseTrackerProvider,
  PoseCamera,
  usePoseTracker,
} from '@pose-tracker/pose-estimation-web-react';

function Screen() {
  usePoseTracker({ onKeypoints: (e) => console.log(e.keypoints.length) });
  return <PoseCamera style={{ height: 480 }} />;
  // Video / image: <PoseCamera source="image" sourceFile={file} />
  // or sourceUrl — see docs/MEDIA_SOURCES.md · https://docs.posetracker.com/media-sources
}

export function App() {
  return (
    <PoseTrackerProvider options={{ model: 'movenet' }}>
      <Screen />
    </PoseTrackerProvider>
  );
}