謝辞:このページで紹介するソフトウェア等の作者に感謝します.
【Python のインストールでの注意点】
Windows で,ユーザ名が日本語のとき,あとでトラブルが発生するかもしれない. トラブルの回避のため, Python をシステム管理者の領域にインストール(パソコンの全ユーザの共有領域)する.
【Python 3.7 のインストール手順の詳細(別ページ) 】
Windows での Python 3.7 のインストール: 別ページ »で説明
【Python の公式ページ】
【インストール手順の概要】
ページの上の方にある「Downloads」をクリック,「Downloads」の下にメニューが出るので,その中の「Windows」をクリック.
そして,Python 3.7.x (x は数字)を探す.
そして,Windows の 64ビット版のインストーラをダウンロードしたいので,「Windows x86-64 executable installer」を選ぶ
※ すでに Python ランチャーをインストール済みのときは, 「Install launcher for all users (recommended)」がチェックできないようになっている場合がある.そのときは,チェックせずに進む.
Python のインストールディレクトリは,「C:\Program Files\Python37」のように自動設定されることを確認.
「Install」をクリック
py とpip にパスが通っていることの確認である.
where py where pip
where py では「C:\Windows\py.exe」 が表示され, where pip では「C:\Program Files\Python37\Scripts\pip.exe」 が表示されることを確認.
Python の使用は「py -3.7」で行う.
py -3.7 -m pip install -U pip setuptools
コマンドプロンプトを管理者として実行: 別ページ »で説明
次のコマンドを実行する
次のコマンドを実行する
Python の使用は「C:\venv\py37\Scripts\activate.bat」の後,「python」で行う.
C:\venv\py37\Scripts\activate.bat python -m pip install -U pip setuptools jupyterlab jupyter jupyter-console jupytext nteract_on_jupyter
Windows での Visual Studio Community 2017,NVIDIA ドライバ,NVIDIA CUDA ツールキット 10.0,NVIDIA cuDNN 7.6.5 のインストール: 別ページ »で説明
URL: https://github.com/1adrianb/face-alignment
コマンドプロンプトを管理者として実行: 別ページ »で説明
cd %HOMEPATH% rmdir /s /q face-alignment cd %HOMEPATH% git clone https://github.com/1adrianb/face-alignment cd face-alignment
scipy 1.4 か,それ以下が必要.
C:\venv\py37\Scripts\activate.bat pip install scipy==1.4.1 pip install -r requirements.txt pip install -U torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117
python setup.py build python setup.py install
エラーメッセージが出ていないこと
https://github.com/1adrianb/face-alignmentに記載のプログラムを実行
まず,次のコマンドを実行
C:\venv\py37\Scripts\activate.bat jupyter qtconsole
Python プログラムを実行する
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に記載のプログラムを使用
次の Python プログラムを実行する
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()