pose_estimation

License OS Python

CodeQL Advanced CI Python Lint

๐Ÿ‡บ๐Ÿ‡ธ English | ๐Ÿ‡ฎ๐Ÿ‡ณ เคนเคฟเค‚เคฆเฅ€ | ๐Ÿ‡ฏ๐Ÿ‡ต ๆ—ฅๆœฌ่ชž | ๐Ÿ‡จ๐Ÿ‡ณ ็ฎ€ไฝ“ไธญๆ–‡ | ๐Ÿ‡ช๐Ÿ‡ธ Espaรฑol | ๐Ÿ‡ง๐Ÿ‡ท Portuguรชs (Brasil) | ๐Ÿ‡ฐ๐Ÿ‡ท ํ•œ๊ตญ์–ด | ๐Ÿ‡ฉ๐Ÿ‡ช Deutsch | ๐Ÿ‡ซ๐Ÿ‡ท Franรงais

"web_ui"

[!NOTE] ์ด ๋ฌธ์„œ๋Š” README์˜ ๋ฒˆ์—ญ๋ณธ์ž…๋‹ˆ๋‹ค. ์˜์–ด ๋ฒ„์ „์ด ๊ธฐ์ค€ ๋ฌธ์„œ์ž…๋‹ˆ๋‹ค.

2D ์ด๋ฏธ์ง€์—์„œ ํฌ์ฆˆ ์ถ”์ •์„ ์ˆ˜ํ–‰ํ•˜๊ธฐ ์œ„ํ•œ ์ปจํ…Œ์ด๋„ˆ์ž…๋‹ˆ๋‹ค.


Pose-to-VRM ๋ณธ ๋งคํ•‘

backend๋Š” BODY_25 ์Šคํƒ€์ผ์˜ pose keypoints์™€ bone pairs๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. MediaPipe mode์—์„œ๋Š” Neck์ด LShoulder์™€ RShoulder์—์„œ ํ•ฉ์„ฑ๋˜๊ณ , MidHip์€ LHip๊ณผ RHip์—์„œ ํ•ฉ์„ฑ๋ฉ๋‹ˆ๋‹ค. ์ถ”์ •๋œ pose๋ฅผ VRM humanoid skeleton์œผ๋กœ ์ „์†กํ•  ๋•Œ ์•„๋ž˜ ํ‘œ๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”.

์ถ”์ • pose vector ์ž…๋ ฅ keypoints VRM humanoid bone ์šฐ์„ ์ˆœ์œ„ Notes
Body root MidHip, LHip, RHip hips Required ์ฃผ๋กœ root rotation์— ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋‹จ์ผ ์ด๋ฏธ์ง€์—์„œ ์–ป์€ root translation์„ ๊ณผ์‹ ํ•˜์ง€ ๋งˆ์„ธ์š”.
Spine MidHip -> Neck spine Required ์ƒ์ฒด์˜ ๊ธฐ๋ณธ ๋ฐฉํ–ฅ์ž…๋‹ˆ๋‹ค.
Chest MidHip -> Neck chest Recommended ๊ณผ๋„ํ•œ ๊ตฝํž˜์„ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด spine๋ณด๋‹ค ์•ฝํ•œ weight๋กœ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.
Upper chest MidHip -> Neck upperChest Optional ๋กœ๋“œ๋œ VRM model์— ์ด bone์ด ์žˆ์„ ๋•Œ๋งŒ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
Neck Neck -> Nose neck Recommended ๋‹จ์ผ ์ด๋ฏธ์ง€ pose estimation์—์„œ๋Š” head์™€ neck landmarks์— ๋…ธ์ด์ฆˆ๊ฐ€ ๋งŽ์œผ๋ฏ€๋กœ ๋ถ€๋“œ๋Ÿฝ๊ฒŒ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.
Head Neck -> Nose, Nose -> LEye, Nose -> REye, LEye -> LEar, REye -> REar head Recommended simple fallback์€ Neck -> Nose๋งŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. eye์™€ ear points๋Š” ๋ฐ”๋ผ๋ณด๋Š” ๋ฐฉํ–ฅ์„ ๊ฐœ์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
Left shoulder Neck -> LShoulder leftShoulder Optional VRM์— shoulder bones๊ฐ€ ์žˆ์„ ๋•Œ๋งŒ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ด bone ์—†์ด๋„ arm์„ ๊ตฌ๋™ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
Left upper arm LShoulder -> LElbow leftUpperArm Required ์™ผ์ชฝ ์ƒ์™„์˜ ๊ธฐ๋ณธ ํšŒ์ „์ž…๋‹ˆ๋‹ค.
Left lower arm LElbow -> LWrist leftLowerArm Required ์™ผ์ชฝ ์ „์™„์˜ ๊ธฐ๋ณธ ํšŒ์ „์ž…๋‹ˆ๋‹ค.
Left hand LElbow -> LWrist or hand landmarks leftHand Optional BODY_25๋Š” wrist orientation์„ ์ถฉ๋ถ„ํžˆ ์ œ๊ณตํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. hand landmarks๊ฐ€ ์—†์œผ๋ฉด ์•ฝํ•œ fallback์œผ๋กœ ์‚ฌ์šฉํ•˜์„ธ์š”.
Right shoulder Neck -> RShoulder rightShoulder Optional VRM์— shoulder bones๊ฐ€ ์žˆ์„ ๋•Œ๋งŒ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
Right upper arm RShoulder -> RElbow rightUpperArm Required ์˜ค๋ฅธ์ชฝ ์ƒ์™„์˜ ๊ธฐ๋ณธ ํšŒ์ „์ž…๋‹ˆ๋‹ค.
Right lower arm RElbow -> RWrist rightLowerArm Required ์˜ค๋ฅธ์ชฝ ์ „์™„์˜ ๊ธฐ๋ณธ ํšŒ์ „์ž…๋‹ˆ๋‹ค.
Right hand RElbow -> RWrist or hand landmarks rightHand Optional BODY_25๋Š” wrist orientation์„ ์ถฉ๋ถ„ํžˆ ์ œ๊ณตํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. hand landmarks๊ฐ€ ์—†์œผ๋ฉด ์•ฝํ•œ fallback์œผ๋กœ ์‚ฌ์šฉํ•˜์„ธ์š”.
Left upper leg LHip -> LKnee leftUpperLeg Required ์™ผ์ชฝ ํ—ˆ๋ฒ…์ง€์˜ ๊ธฐ๋ณธ ํšŒ์ „์ž…๋‹ˆ๋‹ค.
Left lower leg LKnee -> LAnkle leftLowerLeg Required ์™ผ์ชฝ ์ •๊ฐ•์ด์˜ ๊ธฐ๋ณธ ํšŒ์ „์ž…๋‹ˆ๋‹ค.
Left foot LAnkle -> LBigToe, LAnkle -> LHeel leftFoot Recommended toe์™€ heel points๊ฐ€ ๋ณด์ผ ๋•Œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
Left toes LHeel -> LBigToe leftToes Optional VRM์— toe bones๊ฐ€ ์žˆ๊ณ  toe landmarks๊ฐ€ ์•ˆ์ •์ ์ผ ๋•Œ๋งŒ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
Right upper leg RHip -> RKnee rightUpperLeg Required ์˜ค๋ฅธ์ชฝ ํ—ˆ๋ฒ…์ง€์˜ ๊ธฐ๋ณธ ํšŒ์ „์ž…๋‹ˆ๋‹ค.
Right lower leg RKnee -> RAnkle rightLowerLeg Required ์˜ค๋ฅธ์ชฝ ์ •๊ฐ•์ด์˜ ๊ธฐ๋ณธ ํšŒ์ „์ž…๋‹ˆ๋‹ค.
Right foot RAnkle -> RBigToe, RAnkle -> RHeel rightFoot Recommended toe์™€ heel points๊ฐ€ ๋ณด์ผ ๋•Œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
Right toes RHeel -> RBigToe rightToes Optional VRM์— toe bones๊ฐ€ ์žˆ๊ณ  toe landmarks๊ฐ€ ์•ˆ์ •์ ์ผ ๋•Œ๋งŒ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
Left eye Nose -> LEye leftEye Optional gaze ๋˜๋Š” expression features์—๋งŒ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
Right eye Nose -> REye rightEye Optional gaze ๋˜๋Š” expression features์—๋งŒ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

์ตœ์†Œํ•œ์œผ๋กœ ์œ ์šฉํ•œ VRM bones๋Š” spine, leftUpperArm, leftLowerArm, rightUpperArm, rightLowerArm, leftUpperLeg, leftLowerLeg, rightUpperLeg, rightLowerLeg์ž…๋‹ˆ๋‹ค. ์ด๋“ค์ด ์•ˆ์ •๋œ ํ›„์—๋Š” ๋” ์ฝ๊ธฐ ์‰ฌ์šด avatar pose๋ฅผ ์œ„ํ•ด hips, chest, neck, head, leftFoot, rightFoot๋ฅผ ์ถ”๊ฐ€ํ•˜์„ธ์š”.


ํ”„๋กœ์ ํŠธ ์‹œ์ž‘ํ•˜๊ธฐ

cp .env.example .env
docker compose up --build

๋ธŒ๋ผ์šฐ์ €๋ฅผ ์—ฝ๋‹ˆ๋‹ค:

http://localhost:8081

API๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค:

curl http://localhost:8000/api/v1/health

์‚ฌ์šฉ ๋ฐฉ๋ฒ•

  1. โ€œSelect imageโ€๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
  2. image๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  3. image ์œ„์— ์˜ค๋ฒ„๋ ˆ์ด๋œ 2D keypoints๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  4. ์•„๋ž˜์ชฝ โ€œ3D skeleton checkโ€ view์—์„œ pose direction์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

Tests

backend tests ์‹คํ–‰:

docker compose -f docker-compose.test.yml run --rm backend_test

frontend smoke test ์‹คํ–‰:

docker compose -f docker-compose.yml -f docker-compose.test.yml run --rm frontend_test

License

  • Apache License 2.0