Pose Estimation
Pose Estimation
Estimating the positions of human body joints in an image. AR, fitness apps.
Pose Estimation
Estimating the positions of human body joints in an image. AR, fitness apps.
Pose Estimation is a Computer Vision technique that detects and connects the locations of human body joints (keypoints) in images or video to determine posture. It typically estimates 17-25 keypoints (nose, eyes, shoulders, elbows, wrists, hips, knees, ankles, etc.) and connects them to form a skeleton. 2D pose estimation predicts coordinates on the image plane, while 3D pose estimation predicts spatial coordinates that include depth information.
Pose estimation research has been dominated by Deep Learning-based approaches, beginning with DeepPose in 2014. The emergence of OpenPose in 2017 made real-time multi-person pose estimation possible, and HRNet, AlphaPose, and others subsequently improved accuracy. In 2024-2025, lightweight models such as RTMPose and YOLOv8-Pose enabled real-time processing on mobile and Edge devices, and Transformer-based models such as ViTPose are achieving the highest accuracy.
Pose estimation approaches are broadly divided into two types. The Top-down approach first detects people (Detection) and then estimates the pose within each person's bounding box. It has high accuracy, but the computational cost increases in proportion to the number of people. The Bottom-up approach first detects all keypoints and then connects the keypoints that belong to the same person. Its computational cost is constant regardless of the number of people, which makes it advantageous for real-time processing. OpenPose is a representative Bottom-up model, and HRNet is a representative Top-down model.
In practice, pose estimation is used in a wide variety of fields, including sports analysis (posture correction, motion analysis), fitness apps (rep counting, form checking), AR/VR (avatar motion mapping), healthcare (rehabilitation monitoring, gait analysis), security (abnormal behavior detection), and gaming (motion recognition controllers). As of 2025, real-time pose estimation at 30FPS or higher is possible even on smartphones based on MediaPipe and TensorFlow Lite, and it is used as a core input method in XR devices such as Apple Vision Pro.
This is an example of real-time pose estimation using MediaPipe.
# MediaPipe 포즈 추정
# pip install mediapipe opencv-python
import cv2
import mediapipe as mp
# MediaPipe 포즈 솔루션 초기화
mp_pose = mp.solutions.pose
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
# 포즈 모델 설정
pose = mp_pose.Pose(
static_image_mode=False, # 비디오 모드
model_complexity=1, # 0: Lite, 1: Full, 2: Heavy
enable_segmentation=False, # 배경 분할
min_detection_confidence=0.5,
min_tracking_confidence=0.5
)
# 웹캠 캡처
cap = cv2.VideoCapture(0)
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
# BGR to RGB 변환
image_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
# 포즈 추정 수행
results = pose.process(image_rgb)
# 결과 시각화
if results.pose_landmarks:
# 스켈레톤 그리기
mp_drawing.draw_landmarks(
frame,
results.pose_landmarks,
mp_pose.POSE_CONNECTIONS,
landmark_drawing_spec=mp_drawing_styles.get_default_pose_landmarks_style()
)
# 특정 관절점 좌표 추출 (예: 오른쪽 어깨)
right_shoulder = results.pose_landmarks.landmark[mp_pose.PoseLandmark.RIGHT_SHOULDER]
h, w, _ = frame.shape
x, y = int(right_shoulder.x * w), int(right_shoulder.y * h)
cv2.putText(frame, f"Shoulder: ({x}, {y})", (10, 30),
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2)
cv2.imshow('MediaPipe Pose', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
pose.close()
This is an example of multi-person pose estimation using YOLOv8-Pose.
# YOLOv8 포즈 추정
# pip install ultralytics opencv-python
from ultralytics import YOLO
import cv2
# YOLOv8 포즈 모델 로드
model = YOLO('yolov8n-pose.pt') # nano 버전 (빠름)
# model = YOLO('yolov8m-pose.pt') # medium 버전 (균형)
# model = YOLO('yolov8x-pose.pt') # xlarge 버전 (정확)
# 이미지에서 포즈 추정
image_path = 'people.jpg'
results = model(image_path)
for result in results:
# 키포인트 정보
keypoints = result.keypoints
if keypoints is not None:
# 각 감지된 사람의 포즈
for person_idx, person_kpts in enumerate(keypoints.data):
print(f"\n=== 사람 {person_idx + 1} ===")
# COCO 17 keypoints
keypoint_names = [
'nose', 'left_eye', 'right_eye', 'left_ear', 'right_ear',
'left_shoulder', 'right_shoulder', 'left_elbow', 'right_elbow',
'left_wrist', 'right_wrist', 'left_hip', 'right_hip',
'left_knee', 'right_knee', 'left_ankle', 'right_ankle'
]
for kpt_idx, kpt in enumerate(person_kpts):
x, y, conf = kpt[0].item(), kpt[1].item(), kpt[2].item()
if conf > 0.5: # 신뢰도 임계값
print(f" {keypoint_names[kpt_idx]}: ({x:.1f}, {y:.1f}) conf: {conf:.2f}")
# 결과 이미지 저장
result.save(filename='pose_result.jpg')
# 비디오에서 실시간 포즈 추정
cap = cv2.VideoCapture(0)
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
# 추론
results = model(frame, verbose=False)
# 결과 시각화
annotated_frame = results[0].plot()
cv2.imshow('YOLOv8 Pose', annotated_frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
This is a comparison of major pose estimation models as of January 2025.
| Model | COCO AP | Speed (FPS) | Parameter | Use case |
|---|---|---|---|---|
| MediaPipe Pose | ~68% | ~50 (CPU) | 3M | Mobile/Web |
| YOLOv8n-Pose | 50.4% | ~150 | 3.3M | Edge/Real-time |
| YOLOv8x-Pose | 69.2% | ~30 | 69M | Server/High-precision |
| RTMPose-L | 72.3% | ~45 | 27M | Balanced |
| ViTPose-H | 79.1% | ~10 | 632M | Highest accuracy |
* FPS figures are reference values based on NVIDIA RTX 3090
Recommended models by platform:
| Platform | Recommended Model | Expected FPS | Notes |
|---|---|---|---|
| Smartphone (iOS/Android) | MediaPipe Pose | 30-50 | ML Kit integration |
| Web browser | TensorFlow.js PoseNet | 15-30 | WebGL acceleration |
| Edge (Jetson) | YOLOv8n-Pose + TensorRT | 50-80 | INT8 quantization |
| Server (GPU) | RTMPose / ViTPose | 30-100 | Batch processing |
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
When joints are occluded by objects or other people, predictions become unstable. Do not simply ignore low-confidence joints; instead, estimate them by using temporal continuity or body structure constraints.
Deploying a high-accuracy model on mobile causes frame rates to drop. Check the computing capability of the target device first, and choose a model by considering the trade-off between accuracy and speed.
Choose a model that fits the use case. We recommend MediaPipe for mobile, YOLOv8-nano + TensorRT for Edge, and RTMPose for servers. Adjust the confidence threshold, and reduce jitter with temporal smoothing.