LoginSignup
4
1

More than 3 years have passed since last update.

SMPL-xを導入するまで

Posted at

まずは環境構築

pythonのバージョンを3.7的なところにしないといけないので、
まずはpyenvを入れる。そのためにbrewを入れる。

sudo apt-get install build-essential curl file git
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

下記の物をbashrcに追加する。

export PATH='/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin':"$PATH"
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$(brew --prefix)/share/man:$MANPATH"
export INFOPATH="$(brew --prefix)/share/info:$INFOPATH"

bashrcを更新

source ~/.bashrc

pyenv-virtualenvを導入する

brew install pyenv-virtualenv

pyenv-virtualenvのpathを通す

export PYENV_ROOT="/home/hirose/.pyenv"(端末に応じて変更)
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi

bashrcを更新

source ~/.bashrc

ライブラリ追加

sudo apt-get install zlib1g-dev
sudo apt-get install libssl-dev
sudo apt install libffi-dev

python3.7.7をインストール

pyenv install 3.7.7

shellでpython3.7.7に入る

pyenv shell 3.7.7

仮想環境をvenvで作成(今回はtestという仮想環境をつくる)

python3 -m venv test

pipのアップデート

pip3 install --upgrade pip

ここまででpythonとpipの環境作成完了

opencvを導入する

pip install opencv-python

homogenousの導入

opencvを導入する

pip install opencv-python

homogenousの導入

pip install git+https://github.com/nghorbani/homogenus

SMPL-xの導入

pip install smplx[all]
git clone https://github.com/vchoutas/smplx
python setup.py install

vposerの導入

pip install git+https://github.com/nghorbani/configer
pip install git+https://github.com/nghorbani/human_body_prior

vposerフォルダをhttps://smpl-x.is.tue.mpg.de/downloads
からダウンロードしておく

SMPliftyの導入

プラグインを追加しておく(SMPlifty用)

pip install pyyaml
pip install configargparse

SMPliftyをGITからクローンする

git clone https://github.com/vchoutas/smplify-x

fit_smplx.yamlでinterpenetration = Falseを設定
smplifty-xを実行

python smplifyx/main.py --config cfg_files/fit_smplx.yaml --data_folder ./data --output_folder ./output --visualize False --model_folder /home/hirose/smplx/models --vposer_ckpt /home/hirose/smplx/human_body_prior/vposer_v1_0 --part_segm_fn smplx_parts_segm.pkl
4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1