You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-human-pose

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-human-pose

A real time human pose detection using machine learning model posenet in react native.

1.1.1
latest
Source
npmnpm
Version published
Weekly downloads
2
-81.82%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-human-pose

A Light Weight, performative package to quickly get human pose from a mobile camera

Installation

npm i react-native-human-pose react-native-webview

OR

yarn add react-native-human-pose react-native-webview

Android

Go to android/app/src/main/AndroidManifest.xml and add this line

<uses-permission android:name="android.permission.CAMERA" />

iOS

cd ios && pod install

Also go to ios/<project name>/Info.plist and these lines

<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to your Camera.</string>

Sample Usage

import React from 'react';
import HumanPose from 'react-native-human-pose';
import {View, Text} from 'react-native';

const App = () => {
  const onPoseDetected = (pose: any) => {
    console.log('pose', pose);
  };
  return (
    <View style={{flex:1}}>
      <Text>Human Pose</Text>
      <HumanPose
        height={200}
        width={300}
        enableKeyPoints={true}
        flipHorizontal={false}
        isBackCamera={false}
        color={'255, 0, 0'}
        onPoseDetected={onPoseDetected}
      />
    </View>
  );
};

export default App;

A pose is an array of no of poses detected inside the frame

Props Passed

  • width?: number // Width for the video component
  • height?: number // Height for the video component
  • enableSkeleton?: boolean // Wheather you want to enable skeleton or not. Default: true
  • enableKeyPoints?: boolean // Wheather you want to enable keypoints or not. Default: true
  • color?: string // Color of keypoints and skeleton in 'RR, GG, BB' format
  • mode?: 'single' | 'multiple' // Pose detection mode to detect single person or multiple persons
  • scoreThreshold?: number // A confidence score to mark keypoint between 0 and 1. Default: 0.5
  • isBackCamera?: boolean // Capture from back camera of device. Default: false
  • flipHorizontal?: boolean // Flip video horizontally
  • onPoseDetected?: (pose: any) => void // A callback called on each pose detected on each frame

Keywords

react-native

FAQs

Package last updated on 09 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts