[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,89 +2,165 @@
|
||||
id: wiki-2026-0508-pose-estimation
|
||||
title: Pose Estimation
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [CV-POSE-001]
|
||||
aliases: [Human Pose Estimation, HPE, Keypoint Detection]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 1.0
|
||||
tags: ["Computer Vision|[Computer-Vision", pose-estimation, keypoint-detection, Human-Computer-Interaction, mediapipe, motion-capture]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [computer-vision, pose-estimation, deep-learning, keypoints]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-26
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: python
|
||||
framework: pytorch, mmpose, mediapipe
|
||||
---
|
||||
|
||||
# Pose Estimation (자세 추정)
|
||||
# Pose Estimation
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "인체의 겉모습 너머에 숨겨진 '해골 구조(Skeletal Structure)'를 발굴하여, 인간의 움직임을 기계가 이해할 수 있는 좌표의 시퀀스로 번역하라" — 이미지나 비디오에서 인체의 주요 관절(Keypoints) 위치를 탐지하고 이들의 연결 관계를 통해 전체적인 자세나 동작을 파악하는 기술.
|
||||
## 매 한 줄
|
||||
> **"매 image/video에서 인체 keypoints (joints) 위치 detection."**. OpenPose (2017)가 multi-person bottom-up을 popularize, MediaPipe로 mobile real-time, 2024-2025 ViTPose / SAM-style transformer가 SOTA.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
- **추출된 패턴:** "Part-based Representation and Geometric Constraints" — 신체를 머리, 어깨, 무릎 등 여러 부위로 나누어 각 부위의 존재 확률 맵(Heatmap)을 생성하고, 인체 구조상 가능한 연결 범위를 고려하여 전체적인 포즈를 완성하는 패턴.
|
||||
- **주요 접근 방식:**
|
||||
- **2D Pose Estimation:** 평면 이미지상의 x, y 좌표 추출 (OpenPose, MediaPipe 등).
|
||||
- **3D Pose Estimation:** 깊이 정보를 포함한 입체 좌표 추출.
|
||||
- **Bottom-up:** 이미지 내 모든 관절점을 먼저 찾고 각 사람에게 할당 (다수 인원에 유리).
|
||||
- **Top-down:** 사람을 먼저 탐지(Object Detection)하고 그 안에서 관절 추출 (정밀도에 유리).
|
||||
- **의의:** 홈 트레이닝 앱의 동작 교정, 수어 번역, 영화/게임의 모션 캡처, 보행자 행동 예측 등 인간 중심의 인터랙션이 필요한 모든 지능형 서비스의 핵심 기술.
|
||||
## 매 핵심
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌:** 고가의 마커를 몸에 붙여야 했던 전용 장비 기반의 모션 캡처 시장에서, 이제는 스마트폰 카메라 한 대와 가벼운 신경망 모델만으로도 실시간 자세 추정이 가능한 '마커리스(Markerless)' 시대로 완전히 진입함.
|
||||
- **정책 변화:** Antigravity 프로젝트는 에이전트의 제스처 인식 기능을 개발할 때, 사용자 개인정보 보호를 위해 이미지를 직접 저장하지 않고 랜드마크 좌표(Keypoints)만을 추출하여 처리하는 보안 중심의 자세 추정 파이프라인을 구축함.
|
||||
### 매 두 가지 paradigm
|
||||
- **Top-down**: detect person bbox → crop → keypoint regression. 매 정확, slow with crowd.
|
||||
- **Bottom-up**: keypoints first → group into persons (PAF / associative embedding). 매 fast at scale.
|
||||
- **Single-stage** (modern): YOLO-Pose, ED-Pose — detection + keypoints joint.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- [[Object-Detection-Foundations|Object-Detection-Foundations]], Computer-Vision-Foundations, [[Personal-Information-Security|Personal-Information-Security]], Hugging-Face-Integration
|
||||
- **Raw Source:** 10_Wiki/Topics/AI/Pose-Estimation.md
|
||||
### 매 표현 방식
|
||||
- **2D keypoints**: (x, y, confidence) — COCO 17 keypoints standard.
|
||||
- **3D pose**: (x, y, z) — single image lift 또는 multi-view.
|
||||
- **SMPL / mesh**: full body parametric model — VIBE, HMR, 4D-Humans.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### 매 응용
|
||||
1. AR/VR avatar driving (Meta Quest, Apple Vision Pro).
|
||||
2. Fitness coaching (form correction).
|
||||
3. Sports analytics (gait, biomechanics).
|
||||
4. Animation mocap markerless.
|
||||
5. Surveillance / fall detection.
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
## 💻 패턴
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
### MediaPipe (real-time, on-device)
|
||||
```python
|
||||
import mediapipe as mp
|
||||
import cv2
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
mp_pose = mp.solutions.pose
|
||||
pose = mp_pose.Pose(model_complexity=1, min_detection_confidence=0.5)
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
cap = cv2.VideoCapture(0)
|
||||
while cap.isOpened():
|
||||
ok, frame = cap.read()
|
||||
if not ok: break
|
||||
results = pose.process(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
|
||||
if results.pose_landmarks:
|
||||
for lm in results.pose_landmarks.landmark:
|
||||
print(lm.x, lm.y, lm.visibility)
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### MMPose (research, ViTPose backbone)
|
||||
```python
|
||||
from mmpose.apis import MMPoseInferencer
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
inferencer = MMPoseInferencer(pose2d='vitpose-h')
|
||||
result = next(inferencer('image.jpg', show=False))
|
||||
keypoints = result['predictions'][0][0]['keypoints'] # (17, 2)
|
||||
scores = result['predictions'][0][0]['keypoint_scores']
|
||||
```
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### YOLO-Pose (Ultralytics, single-stage)
|
||||
```python
|
||||
from ultralytics import YOLO
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
model = YOLO('yolo11n-pose.pt')
|
||||
results = model('image.jpg')
|
||||
for r in results:
|
||||
kpts = r.keypoints.xy # (n_persons, 17, 2)
|
||||
conf = r.keypoints.conf
|
||||
```
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
### 3D lift (VideoPose3D-style)
|
||||
```python
|
||||
import torch
|
||||
# 2D (T, 17, 2) -> 3D (T, 17, 3) via temporal CNN
|
||||
class TemporalLift(torch.nn.Module):
|
||||
def __init__(self, n_kpts=17, ch=1024):
|
||||
super().__init__()
|
||||
self.expand = torch.nn.Conv1d(n_kpts*2, ch, 3, padding=1)
|
||||
self.blocks = torch.nn.Sequential(*[
|
||||
torch.nn.Sequential(
|
||||
torch.nn.Conv1d(ch, ch, 3, padding=1, dilation=d),
|
||||
torch.nn.BatchNorm1d(ch), torch.nn.ReLU()
|
||||
) for d in (3, 9, 27)
|
||||
])
|
||||
self.head = torch.nn.Conv1d(ch, n_kpts*3, 1)
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
def forward(self, x): # x: (B, T, 17, 2)
|
||||
B, T = x.shape[:2]
|
||||
x = x.reshape(B, T, -1).transpose(1, 2)
|
||||
return self.head(self.blocks(self.expand(x))).transpose(1, 2).reshape(B, T, -1, 3)
|
||||
```
|
||||
|
||||
### COCO keypoint metric (OKS / mAP)
|
||||
```python
|
||||
from pycocotools.coco import COCO
|
||||
from pycocotools.cocoeval import COCOeval
|
||||
|
||||
gt = COCO('person_keypoints_val2017.json')
|
||||
dt = gt.loadRes('predictions.json')
|
||||
e = COCOeval(gt, dt, 'keypoints')
|
||||
e.evaluate(); e.accumulate(); e.summarize()
|
||||
# AP @ OKS=.50:.95 — 표준 metric
|
||||
```
|
||||
|
||||
### SMPL mesh recovery (4D-Humans / HMR2)
|
||||
```python
|
||||
from hmr2.models import load_hmr2
|
||||
model, model_cfg = load_hmr2('logs/checkpoints/epoch=35.ckpt')
|
||||
out = model(image_tensor)
|
||||
verts = out['pred_vertices'] # (B, 6890, 3)
|
||||
betas = out['pred_smpl_params']['betas']
|
||||
pose = out['pred_smpl_params']['body_pose']
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Mobile / web real-time | MediaPipe Pose |
|
||||
| Highest accuracy single image | ViTPose-H (MMPose) |
|
||||
| Multi-person crowd | YOLO-Pose / ED-Pose (single-stage) |
|
||||
| 3D from monocular video | 4D-Humans / WHAM |
|
||||
| Animation mocap | SMPL / SMPL-X based |
|
||||
| Edge device < 10ms | MoveNet Lightning, RTMPose-tiny |
|
||||
|
||||
**기본값**: 2D는 RTMPose, 3D mesh는 4D-Humans.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Computer_Vision]] · [[Deep_Learning]]
|
||||
- 변형: [[OpenPose]] · [[MediaPipe]] · [[ViTPose]] · [[SMPL]]
|
||||
- 응용: [[AR_VR]] · [[Motion_Capture]] · [[Action_Recognition]]
|
||||
- Adjacent: [[Object_Detection]] · [[Keypoint_Detection]] · [[Heatmap_Regression]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: vision-action pipeline 의 input feature, fitness/AR app, mocap automation.
|
||||
**언제 X**: facial keypoints는 face-specific model (MediaPipe Face Mesh, dlib), hand는 MediaPipe Hands.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Top-down without bbox tracking**: 매 frame redetect — temporal jitter 매 심각. ByteTrack 결합.
|
||||
- **2D regression direct (x,y) without heatmap**: 매 lower accuracy. Heatmap supervision 매 표준.
|
||||
- **3D from single 2D pose**: depth ambiguity — temporal context 또는 multi-view 필요.
|
||||
- **Ignoring camera intrinsics for 3D**: 매 metric scale wrong.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (MMPose docs, Ultralytics YOLO11-pose, MediaPipe docs, COCO keypoint benchmark).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — pose estimation paradigms + modern stack (ViTPose, YOLO-Pose, 4D-Humans) |
|
||||
|
||||
Reference in New Issue
Block a user