피드로 돌아가기
MediaPipe on iOS: what the docs leave out
Dev.toDev.to
AI/ML

iOS MediaPipe 기반 30fps 실시간 Pose Detection 최적화 전략

MediaPipe on iOS: what the docs leave out

Harshit Diyora2026년 5월 17일7intermediate

Context

MediaPipe 공식 문서의 기본 설정만으로는 프로덕션 환경의 프레임 드랍과 발열 문제를 해결하기 어려움. 특히 장시간 세션이 필요한 물리치료 앱 특성상 Thermal Throttling으로 인한 성능 저하가 핵심 병목 지점으로 작용함.

Technical Solution

  • VGA(640x480) 해상도 설정을 통한 불필요한 연산량 감소 및 Latency 최소화
  • activeVideoMin/MaxFrameDuration 고정을 통한 Timestamp Jitter 제거 및 Temporal Smoothing 안정화
  • kCVPixelFormatType_32BGRA 포맷 강제를 통한 암묵적 Pixel Conversion 비용 제거
  • 기기 모델 및 Thermal State 기반의 CPU/GPU Delegate 동적 선택 전략 도입
  • Front Camera 특성을 고려한 X축 Mirroring 및 Portrait/Landscape 좌표 변환 로직 구현
  • Strong Reference Cycle 방지를 위한 Weak Reference 기반의 Delegate 패턴 적용

1. iOS 카메라 설정 시 Resolution을 VGA로 제한하여 Latency 확인

2. Frame Rate Locking을 통해 MediaPipe의 시간축 데이터 일관성 확보

3. 기기 사양(iPhone 14 Pro 이상 여부)에 따른 Delegate 분기 처리 검토

4. Front Camera 적용 시 좌표계 Mirroring 및 Rotation 처리 필수 적용

5. Simulator 환경을 위한 Video File Injection 파이프라인 구축

원문 읽기