PoseEstimationLib.js
๐ Introduce
- ํน์ ํฌ์ฆ๋ฅผ ์ทจํ๊ณ ์๋์ง ํ์ธํ ์ ์๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋๋ค.
-
@tensorflow/posenet
๋ฅผ ํตํด ์ด๋ฏธ์ง์์ ํฌ์ฆ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํฉ๋๋ค. - ์ถ์ถ๋ ํฌ์ฆ ๋ฐ์ดํฐ์์ ์๋ ์์น, ๊ฐ๋, ๋ฐฉํฅ, ์๋ ๋ฐ์ดํฐ๋ฅผ ๊ณ์ฐํ๊ณ ์ด๋ฅผ ํตํด ํน์ ํ ์์ธ๋ฅผ ์ทจํ๊ณ ์๋์ง ํ์ธํฉ๋๋ค.
๐ โInstallation
npm
npm install pose-estimation-lib.js
yarn
yarn add pose-estimation-lib.js
๐ Getting Started
import * as posenet from "@tensorflow-models/posenet";
import * as pelib from "pose-estimation-lib.js/dist/src/pose";
import * as peutils from "pose-estimation-lib.js/dist/src/uitls";
async function main() {
const imgElement = ...
const flipHorizontal = true;
// initialize posenet
const net = await posenet.load({
architecture: "ResNet50",
outputStride: 16,
inputResolution: 200,
multiplier: 1,
quantBytes: 1
});
// estimation pose from imgElement
const pose = await net.estimatePoses(imgElement, {
decodingMethod: "single-person",
flipHorizontal
});
const isLeftUp = pelib.isLeftHandUp(pose);
console.log("isLeftHandUp", isLeftUp);
}
main();
๐ Document
1. Left Hand Up
Example Code
const isLeftUp = pelib.isLeftHandUp(pose);
console.log("isLeftHandUp", isLeftUp);
2. Left Hand Up (Big)
Example Code
const isLeftUpBig = pelib.isLeftHandUp(pose, 90);
console.log("isLeftUpBig", isLeftUpBig);
3. Right Hand Up
Example Code
const isRightUp = pelib.isRightHandUp(pose);
console.log("isRightHandUp", isRightUp);
4. Right Hand Up (Big)
Example Code
const isRightUp = pelib.isRightHandUp(pose, 90);
console.log("isRightHandUpBig", isRightUp);
5. Jumping
Example Code
let groundY = 0;
// in update loop
groundY = peutils.getGround(pose);
const isJumping = pelib.isJumping(pose, groundY);
console.log("isJumping", isJumping);
6. Sitting
const isSitting = pelib.isSitDown(pose);
console.log("isSitting", isSitting);
๐ โContributing
ํ๋ก์ ํธ ์ฐธ์ฌ๋ ๋๊ตฌ๋ ํ์ํฉ๋๋ค. Github ์ ์ฅ์๋ฅผ ํตํด PR์ ์์ฒญํด์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค.
๐ช Contributors
Jongbok Park |
mine0697782 |
ChanHHOO |
soninsu-beep |
jhg2957 |