t0mark/human-pose-estimation
0
Human Pose Estimation
듀얼 카메라 실시간 인체 자세 추정 서버. SMPLer-X / SMPLest-X 기반으로 SMPL-X 3D mesh를 실시간으로 추론하고 웹 UI로 스트리밍합니다.
모델 선택
설치
1. 레포 클론
# 코드 + 가중치 전체 다운로드 (약 10GB, LFS 필요)
git lfs install
git clone https://huggingface.co/tomark/human-pose-estimation
cd human-pose-estimation가중치만 제외하고 코드만 먼저 받으려면:
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/tomark/human-pose-estimation
cd human-pose-estimation2. 가중치 개별 다운로드 (선택)
코드만 클론한 경우 아래 명령으로 필요한 파일만 받을 수 있습니다.
pip install huggingface_hub
python - <<'EOF'
from huggingface_hub import hf_hub_download
# YOLOv8 (인체 검출)
hf_hub_download("tomark/human-pose-estimation", "pretrained_models/yolov8x.pt", local_dir=".")
# SMPLer-X (small / base 중 필요한 것만)
hf_hub_download("tomark/human-pose-estimation", "pretrained_models/smpler_x_s32.pth.tar", local_dir=".")
hf_hub_download("tomark/human-pose-estimation", "pretrained_models/smpler_x_b32.pth.tar", local_dir=".")
# SMPLest-X-H (huge, 7.7GB)
hf_hub_download("tomark/human-pose-estimation", "pretrained_models/smplest_x_h/smplest_x_h.pth.tar", local_dir=".")
hf_hub_download("tomark/human-pose-estimation", "pretrained_models/smplest_x_h/config_base.py", local_dir=".")
EOF3. SMPL-X 인체 모델 파일 다운로드
SMPLest-X-H 사용 시 필요합니다. SMPL-X 공식 사이트에서 계정 생성 후 다운로드.
다운로드한 파일을 아래 경로에 배치:
SMPLest-X/human_models/human_model_files/smplx/
├── SMPLX_NEUTRAL.npz
├── SMPLX_NEUTRAL.pkl
├── SMPLX_MALE.npz
├── SMPLX_MALE.pkl
├── SMPLX_FEMALE.npz
├── SMPLX_FEMALE.pkl
├── SMPLX_to_J14.pkl
├── MANO_SMPLX_vertex_ids.pkl
├── SMPL-X__FLAME_vertex_ids.npy
└── smplx_npz.zip4. Python 패키지 설치
pip install -r SMPLer-X/requirements.txt
pip install -r SMPLest-X/requirements.txt사용법
# SMPLer-X Small (기본, 가장 빠름)
python run.py --variant small
# SMPLer-X Base
python run.py --variant base
# SMPLest-X Huge (고정밀)
python run.py --variant huge
# 카메라 인덱스 및 포트 지정
python run.py --variant small --cam0 0 --cam1 1 --port 5000실행 후 브라우저에서 http://localhost:5000 접속.
디렉토리 구조
.
├── run.py # 메인 서버 (듀얼 카메라)
├── web.py # Flask 웹 UI
├── camera.py # 카메라 캡처 모듈
├── smpler.py # SMPLer-X 로더
├── smplest.py # SMPLest-X 로더
├── pretrained_models/ # 가중치 (LFS)
│ ├── yolov8x.pt
│ ├── smpler_x_s32.pth.tar
│ ├── smpler_x_b32.pth.tar
│ └── smplest_x_h/
│ └── smplest_x_h.pth.tar
├── SMPLer-X/ # SMPLer-X 서브모듈
└── SMPLest-X/ # SMPLest-X 서브모듈