- ํน์ ํฌ์ฆ๋ฅผ ์ทจํ๊ณ ์๋์ง ํ์ธํ ์ ์๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋๋ค.
@tensorflow/posenet๋ฅผ ํตํด ์ด๋ฏธ์ง์์ ํฌ์ฆ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํฉ๋๋ค.- ์ถ์ถ๋ ํฌ์ฆ ๋ฐ์ดํฐ์์ ์๋ ์์น, ๊ฐ๋, ๋ฐฉํฅ, ์๋ ๋ฐ์ดํฐ๋ฅผ ๊ณ์ฐํ๊ณ ์ด๋ฅผ ํตํด ํน์ ํ ์์ธ๋ฅผ ์ทจํ๊ณ ์๋์ง ํ์ธํฉ๋๋ค.
npm install pose-estimation-lib.jsyarn add pose-estimation-lib.jsimport * 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();const isLeftUp = pelib.isLeftHandUp(pose);
console.log("isLeftHandUp", isLeftUp);const isLeftUpBig = pelib.isLeftHandUp(pose, 90);
console.log("isLeftUpBig", isLeftUpBig);const isRightUp = pelib.isRightHandUp(pose);
console.log("isRightHandUp", isRightUp);const isRightUp = pelib.isRightHandUp(pose, 90);
console.log("isRightHandUpBig", isRightUp);let groundY = 0;
// in update loop
groundY = peutils.getGround(pose);
const isJumping = pelib.isJumping(pose, groundY);
console.log("isJumping", isJumping);const isSitting = pelib.isSitDown(pose);
console.log("isSitting", isSitting);ํ๋ก์ ํธ ์ฐธ์ฌ๋ ๋๊ตฌ๋ ํ์ํฉ๋๋ค. Github ์ ์ฅ์๋ฅผ ํตํด PR์ ์์ฒญํด์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค.
|
Jongbok Park |
mine0697782 |
ChanHHOO |
soninsu-beep |
jhg2957 |




