3D Hands for all

  • 싱글 RGB 이미지에 3D Hand Pose 주석 도구
  • 도구를 이용해 자동으로 2D/3D 키포인트 추정
  • 키포인트에 최적화된 MANO Hand Pose 제공
  • 손 관절의 물리적 제약 조건을 추가하여 더욱 정교함
  • 이 도구는 우리의 논문 Ego2HandsPose 데이터셋을 어노테이션하기 위해 사용됨
  • Git: https://github.com/AlextheEngineer/3DHandsForAll


환경 세팅

설치 환경

  • OS: Windows 10 64bit
  • GPU: RTX 3080 10GB
  • CUDA: CUDA Toolkit 11.2, Cudnn 8.2
  • Python: Anaconda 가상 환경
  • Date: 2023.06.02

아나콘다 설정

conda create --name hand3d_env python=3.7  
conda activate hand3d_env  
# conda install -c conda-forge opencv (pip로 대체)
 
# 자신의 환경에 맞는 cuda torch 설치
conda install pytorch torchvision torchaudio cudatoolkit=10.1 -c pytorch (see [https://pytorch.org/](https://pytorch.org/) for a 
proper setting specific for your machine)
 
# CUDA 11.2 에서 세팅
# conda 에서 11.2 버전은 제공하지 않으므로 하위 버전인 11.1 설치
# 참고: https://pytorch.org/get-started/previous-versions/
 
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch-lts -c conda-forge
# torch 설치 확인
 
import torch
 
torch.cuda.get_device_name(0)
>> 'NVIDIA GeForce RTX 3080'
 
torch.cuda.is_available()
>> True

MANO 설치

  1. MANO 저장소( https://github.com/hassony2/manopth ) 를 models/MANO_layer 위치에 다운로드
  2. setup.py 파일이 models/MANO_layer/manopth/setup.py 위치에 있어야함
MANO_layer/
  manopth/
    mano/
    manopth/
    examples/
	setup.py
    ...
  1. setup.py 파일의 경로에서 pip install . 실행
  2. 설치 확인 from manopth.manolayer import ManoLayer

--- 추가 --- MANO pickle data-structures 다운로드

  1. MANO Website(http://mano.is.tue.mpg.de/) 접속 후 로그인
  2. 모델과 코드 다운로드 (다운로드 파일의 포맷은 mano_v*_*.zip 형태)
  3. 압축 해제 후 models 폴더를 manopth/mano 폴더에 복사
manopth/
  mano/
    models/
      MANO_LEFT.pkl
      MANO_RIGHT.pkl
      ...
  manopth/
    __init__.py
    ...

pytorch3d 설치

  1. fvcore, ioPath 설치 conda install -c fvcore -c iopath -c conda-forge fvcore iopath

  2. pytorch3d-0.6.2 버전 다운로드 참고: https://github.com/facebookresearch/pytorch3d/releases

  3. 다운로드 경로에서 x64 Native Tools Command Prompt for VS 2019 프롬프트를 이용해 다음 명령어로 설치

set DISTUTILS_USE_SDK=1
pip install -e .
  1. 설치 확인
from pytorch3d.structures import Meshes
import torch
from pytorch3d import _C

(Windows 버전의 pytotch3d 설치는 매우 까다로움. 설치 과정에 대한 이해 필요)


사전학습 모델 다운로드

아래 모델들을 다운로드하여 models_saved 폴더에 배치함

추가 라이브러리 설치

  1. conda opencvDLL load failed 에러가 발생하여 pip install opencv-python으로 대체하여 설치
  2. chumpy 라이브러리 필요 pip install chumpy
  3. MANO test를 위해서 matplotlib 설치 필요 pip install matpoltlib

실행

python pose_annotator.py

결과 이미지

+full +full


사용 방법 (링크 참고)

+full


참고


HandPoseAnnotationTools