謝辞:このページで紹介するソフトウエア等の作者に感謝します.
システム Python を使うことができる(その場合,Python のインストールは行わない)
システム Python を用いるときは,pip, setuptools の更新は次のコマンドで行う.
sudo apt -y update sudo apt -y install python3-pip python3-setuptools
Ubuntu で,システム Python 以外の Python をインストールしたい場合は pyenv が便利である: 別ページで説明している.
Python の URL: http://www.python.org/
【Python, pip の使い方】
Python, pip は,次のコマンドで起動できる.
【Python 開発環境のインストール】
JupyterLab, spyder, nteract (Python 開発環境) のインストールは, Windows でコマンドプロンプトを管理者として実行し, 次のコマンドを実行.
python -m pip install -U pip setuptools jupyterlab jupyter jupyter-console jupytext nteract_on_jupyter spyder
詳しくは,: 別ページで説明している.
JupyterLab, spyder, nteract (Python 開発環境) のインストール: : 別ページで説明している.
URL: https://github.com/1adrianb/face-alignment
mkdir c:\pytools cd c:\pytools rmdir /s /q face-alignment
cd c:\pytools git clone https://github.com/1adrianb/face-alignment cd face-alignment
scipy 1.4 か,それ以下が必要.
pip install scipy==1.4 pip install -r requirements.txt
python setup.py build python setup.py install
エラーメッセージが出ていないこと
エラーメッセージが出なければ OK.
cd c:\pytools cd face-alignment python test\facealignment_test.py
https://github.com/1adrianb/face-alignmentに記載のプログラムを実行
import face_alignment
from skimage import io
fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, flip_input=False)
input = io.imread('./test/assets/aflw-test.jpg')
preds = fa.get_landmarks(input)
print(preds)
%matplotlib inline
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore') # Suppress Matplotlib warnings
plt.imshow(input)
plt.scatter(preds[0][:,0], preds[0][:,1])
https://github.com/1adrianb/face-alignmentに記載のプログラムを実行
import face_alignment
from skimage import io
fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._3D, flip_input=False)
input = io.imread('./test/assets/aflw-test.jpg')
preds = fa.get_landmarks(input)
print(preds)
plt.imshow(input)
from mpl_toolkits import mplot3d
%matplotlib inline
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore') # Suppress Matplotlib warnings
ax = plt.axes(projection="3d")
ax.scatter3D(preds[0][:,0], preds[0][:,1], preds[0][:,2])
plt.show()