openpose-plus のインストール(trustcoinmining/openpose-plus,TensorFlow 1.15.5 を使用)(書きかけ)
前準備
Python 3.7 のインストール(Windows 上)
Pythonは,プログラミング言語の1つ.
【手順】
- Windows で,管理者権限でコマンドプロンプトを起動(手順:Windowsキーまたはスタートメニュー >
cmd
と入力 > 右クリック > 「管理者として実行」)。次のコマンドを実行
winget install --scope machine Python.Python.3.7
AI エディタ Windsurf のインストール
Pythonプログラムの編集・実行には、AI エディタの利用を推奨する。ここでは,Windsurfのインストールを説明する。
管理者権限でコマンドプロンプトを起動(手順:Windowsキーまたはスタートメニュー > cmd と入力 > 右クリック > 「管理者として実行」)し、以下を実行して、Windsurfをシステム全体にインストールする。管理者権限は、wingetの--scope machineオプションでシステム全体にソフトウェアをインストールするために必要となる。
winget install --scope machine Codeium.Windsurf -e --silent
【関連する外部ページ】
Windsurf の公式ページ: https://windsurf.com/
Gitのインストール
管理者権限でコマンドプロンプトを起動(手順:Windowsキーまたはスタートメニュー > cmd と入力 > 右クリック > 「管理者として実行」)し、以下を実行する。管理者権限は、wingetの--scope machineオプションでシステム全体にソフトウェアをインストールするために必要となる。
REM Git をシステム領域にインストール
winget install --scope machine --id Git.Git -e --silent
REM Git のパス設定
set "GIT_PATH=C:\Program Files\Git\cmd"
if exist "%GIT_PATH%" (
echo "%PATH%" | find /i "%GIT_PATH%" >nul
if errorlevel 1 setx PATH "%PATH%;%GIT_PATH%" /M >nul
)
TensorFlow 1.15.5, Keras 2.3.1 のインストール
py -3.7 -m pip uninstall -y tensorflow tensorflow-cpu tensorflow-gpu tensorflow-intel tensorflow-text tensorflow-estimator tf-models-official tf_slim tensorflow_datasets tensorflow-hub keras keras-tuner keras-visualizer scipy pandas matplotlib
# TensorFlow 1.15.5 のため numpy, protobuf の古いバージョンを使用.エラーが出にくいと考えられる numpy 1.16.2, protobuf 3.19.4 を使用
py -3.7 -m pip install -U numpy==1.16.2 protobuf==3.19.4 tensorflow-gpu==1.15.5 keras==2.3.1 scipy==1.5.4
py -3.7 -m pip install git+https://github.com/tensorflow/docs
py -3.7 -m pip install git+https://github.com/tensorflow/examples.git
py -3.7 -m pip install git+https://www.github.com/keras-team/keras-contrib.git
このページで説明のために使用する画像
画像ファイル fruits.jpg, home.jpg のダウンロード
画像ファイル fruits.jpg, home.jpg のダウンロードは, Windows でコマンドプロンプトを管理者として開き 次のコマンドを実行する.
mkdir c:\image
cd c:\image
curl -L https://github.com/opencv/opencv/blob/master/samples/data/fruits.jpg?raw=true -o fruits.jpg
curl -L https://github.com/opencv/opencv/blob/master/samples/data/home.jpg?raw=true -o home.jpg
上のコマンドがうまく
https://github.com/opencv/opencv/tree/master/samples/data
で公開されている fruits.jpg, home.jpg を使用する(謝辞:画像の作者に感謝します)
「tf-models-official==2.1.0.dev2」はインストール時のエラー抑止のため.
openpose-plus のインストール(trustcoinmining/openpose-plus を使用)
cmd
と入力 > 右クリック > 「管理者として実行」)。
py -3.7 -m pip install -U pip setuptools
py -3.7 -m pip install -U cython
py -3.7 -m pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
py -3.7 -m pip install "easydict>=1.8,<=1.10"
py -3.7 -m pip install "opencv-python>=3.4,<3.5"
py -3.7 -m pip install "nltk>=3.3,<3.4"
py -3.7 -m pip uninstall -y tensorflow tensorflow-cpu tensorflow-gpu tensorflow-intel tensorflow-text tensorflow-estimator tf-models-official tf_slim tensorflow_datasets tensorflow-hub keras keras-tuner keras-visualizer
py -3.7 -m pip install -U tensorflow-gpu==1.15.5 tf-models-official==2.1.0.dev2 tf_slim tensorflow_datasets tensorflow-hub keras keras-tuner keras-visualizer
py -3.7 -c "import tensorflow as tf; print(tf.__version__)"
py -3.7 -c "from tensorflow.python.client import device_lib; print(device_lib.list_local_devices())"