0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PRNet in PyTorch 1.1.0のテスト

Posted at

PRNet_PyTorchのチュートリアルを一通り動かした時のメモです.

NVIDIA CUDA環境で学習ー推論を一通り実行する.

minicondaを今回は使用

$ conda create -n prnet python=3.6
$ conda activate prnet
$ git clone https://github.com/tomguluson92/PRNet_PyTorch.git
$ cd ./PRNet_PyTorch 

パッケージをインストール

$ pip install -r requirements.txt 

uv_pos_mapの生成

BFM.mapと300WLP_IBUGデーターセットのダウンロードを行います


$ cd ./utils
$ mkdir BFM
$ mv ./BFM_UV.mat  ./BFM
$ cd ./BFM

以下の.shでGドライブからBFM.matをダウンロードできるので./BFM内に落とす.

FILE_ID=1Bl21HtvjHNFguEy_i1W5g0QOL8ybPzxw
FILE_NAME=BFM.mat


curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=${FILE_ID}" > /dev/null
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"  
curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=${FILE_ID}" -o ${FILE_NAME}
cd ..
mkdir dataset
cd ./dataset

次は300WLPデーターセットを落とします
これも.shから実行可能です.

FILE_ID=16zZdkRUNdj7pGmBpZIwQMA00qGHLLi94
FILE_NAME=300WLP_IBUG.zip


curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=${FILE_ID}" > /dev/null
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"  
curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=${FILE_ID}" -o ${FILE_NAME}

unzip 300WLP_IBUG.zip 
mv 300WLP_TEST\ \(copy\) 300WLP_IBUG

pythonでデーター整形を行う.

 python generate_posmap_300WLP.py --input_dir ./dataset/300WLP_IBUG --save_dir ./300WLP_IBUG/
cd ..

これで学習の準備が整うはずなのでtrainします

python train.py --train_dir ./utils/dataset/300WLP_IBUG

40分ぐらいでデフォルトの設定だと終了します(GTX1080Ti+CUDA10.1)

python inference.py 

テスト用画像はデフォルトの設定で推論が可能です.
Screenshot from 2020-01-01 03-04-10.png

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?