TensorFlow for Python の深顔検出フレームワーク「retina-face」のインストール

スポンサーリンク

TensorFlow for Python の深顔検出フレームワーク「retina-face」のインストールについて解説しています。

「retina-face(https://github.com/serengil/retinaface)」は、顔のランドマークを備えたPython用の深層学習ベースの最先端の顔検出器です。

■Python

今回のPythonのバージョンは、「3.9.9」を使用しています。(Windows11)(pythonランチャーでの確認)

■retina-faceをインストールする

retina-faceをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。

pip install retina-face

起動後、上記のコマンドを入力し、Enterキーを押します。

なお、今回は、pythonランチャーを使用しており、Python Version 3.9.9にインストールを行うために、バージョンの切り替えを行います。

py -3.9 -m pip install retina-face

切り替えるために、上記のコマンドを入力し、Enterキーを押します。

Defaulting to user installation because normal site-packages is not writeable
Collecting retina-face
  Downloading retina_face-0.0.13-py3-none-any.whl (16 kB)
Collecting opencv-python>=3.4.4
  Downloading opencv_python-4.8.0.76-cp37-abi3-win_amd64.whl (38.1 MB)
     |████████████████████████████████| 38.1 MB 6.4 MB/s
Collecting tensorflow>=1.9.0
  Downloading tensorflow-2.13.0-cp39-cp39-win_amd64.whl (1.9 kB)
Requirement already satisfied: numpy>=1.14.0 in c:\users\user_\appdata\roaming\python\python39\site-packages (from retina-face) (1.25.2)
Requirement already satisfied: Pillow>=5.2.0 in c:\users\user_\appdata\roaming\python\python39\site-packages (from retina-face) (10.0.0)
Collecting gdown>=3.10.1
  Downloading gdown-4.7.1-py3-none-any.whl (15 kB)
Collecting filelock
  Downloading filelock-3.12.4-py3-none-any.whl (11 kB)
Requirement already satisfied: requests[socks] in c:\users\user_\appdata\roaming\python\python39\site-packages (from gdown>=3.10.1->retina-face) (2.31.0)
Requirement already satisfied: six in c:\users\user_\appdata\roaming\python\python39\site-packages (from gdown>=3.10.1->retina-face) (1.16.0)
Requirement already satisfied: tqdm in c:\users\user_\appdata\roaming\python\python39\site-packages (from gdown>=3.10.1->retina-face) (4.66.1)
Collecting beautifulsoup4
  Using cached beautifulsoup4-4.12.2-py3-none-any.whl (142 kB)
Collecting tensorflow-intel==2.13.0
  Downloading tensorflow_intel-2.13.0-cp39-cp39-win_amd64.whl (276.5 MB)
     |████████████████████████████████| 276.5 MB 6.8 MB/s
Collecting protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3
  Downloading protobuf-4.24.3-cp39-cp39-win_amd64.whl (430 kB)
     |████████████████████████████████| 430 kB 2.2 MB/s
Collecting typing-extensions<4.6.0,>=3.6.6
  Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB)
Collecting tensorflow-estimator<2.14,>=2.13.0
  Downloading tensorflow_estimator-2.13.0-py2.py3-none-any.whl (440 kB)
     |████████████████████████████████| 440 kB 3.3 MB/s
Collecting astunparse>=1.6.0
  Downloading astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Collecting h5py>=2.9.0
  Downloading h5py-3.9.0-cp39-cp39-win_amd64.whl (2.7 MB)
     |████████████████████████████████| 2.7 MB 6.8 MB/s
Collecting gast<=0.4.0,>=0.2.1
  Downloading gast-0.4.0-py3-none-any.whl (9.8 kB)
Collecting grpcio<2.0,>=1.24.3
  Downloading grpcio-1.58.0-cp39-cp39-win_amd64.whl (4.3 MB)
     |████████████████████████████████| 4.3 MB 2.2 MB/s
Collecting google-pasta>=0.1.1
  Downloading google_pasta-0.2.0-py3-none-any.whl (57 kB)
     |████████████████████████████████| 57 kB 3.8 MB/s
Collecting keras<2.14,>=2.13.1
  Downloading keras-2.13.1-py3-none-any.whl (1.7 MB)
     |████████████████████████████████| 1.7 MB 3.3 MB/s
Collecting termcolor>=1.1.0
  Using cached termcolor-2.3.0-py3-none-any.whl (6.9 kB)
Requirement already satisfied: absl-py>=1.0.0 in c:\users\user_\appdata\roaming\python\python39\site-packages (from tensorflow-intel==2.13.0->tensorflow>=1.9.0->retina-face) (1.4.0)
Collecting libclang>=13.0.0
  Downloading libclang-16.0.6-py2.py3-none-win_amd64.whl (24.4 MB)
     |████████████████████████████████| 24.4 MB 83 kB/s
Requirement already satisfied: packaging in c:\users\user_\appdata\roaming\python\python39\site-packages (from tensorflow-intel==2.13.0->tensorflow>=1.9.0->retina-face) (23.1)
Collecting tensorflow-io-gcs-filesystem>=0.23.1
  Downloading tensorflow_io_gcs_filesystem-0.31.0-cp39-cp39-win_amd64.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 3.3 MB/s
Collecting wrapt>=1.11.0
  Downloading wrapt-1.15.0-cp39-cp39-win_amd64.whl (36 kB)
Collecting flatbuffers>=23.1.21
  Using cached flatbuffers-23.5.26-py2.py3-none-any.whl (26 kB)
Collecting opt-einsum>=2.3.2
  Downloading opt_einsum-3.3.0-py3-none-any.whl (65 kB)
     |████████████████████████████████| 65 kB 1.8 MB/s
Requirement already satisfied: setuptools in c:\users\user_\appdata\roaming\python\python39\site-packages (from tensorflow-intel==2.13.0->tensorflow>=1.9.0->retina-face) (68.1.2)
Collecting numpy>=1.14.0
  Downloading numpy-1.24.3-cp39-cp39-win_amd64.whl (14.9 MB)
     |████████████████████████████████| 14.9 MB 3.3 MB/s
Collecting tensorboard<2.14,>=2.13
  Downloading tensorboard-2.13.0-py3-none-any.whl (5.6 MB)
     |████████████████████████████████| 5.6 MB 6.8 MB/s
Collecting wheel<1.0,>=0.23.0
  Using cached wheel-0.41.2-py3-none-any.whl (64 kB)
Collecting markdown>=2.6.8
  Downloading Markdown-3.4.4-py3-none-any.whl (94 kB)
     |████████████████████████████████| 94 kB 6.8 MB/s
Collecting tensorboard-data-server<0.8.0,>=0.7.0
  Downloading tensorboard_data_server-0.7.1-py3-none-any.whl (2.4 kB)
Collecting google-auth<3,>=1.6.3
  Downloading google_auth-2.23.0-py2.py3-none-any.whl (181 kB)
     |████████████████████████████████| 181 kB 3.3 MB/s
Collecting google-auth-oauthlib<1.1,>=0.5
  Downloading google_auth_oauthlib-1.0.0-py2.py3-none-any.whl (18 kB)
Collecting werkzeug>=1.0.1
  Downloading werkzeug-2.3.7-py3-none-any.whl (242 kB)
     |████████████████████████████████| 242 kB 3.3 MB/s
Collecting urllib3<2.0 Using cached urllib3-1.26.16-py2.py3-none-any.whl (143 kB) Collecting pyasn1-modules>=0.2.1
  Using cached pyasn1_modules-0.3.0-py2.py3-none-any.whl (181 kB)
Collecting rsa<5,>=3.1.4
  Using cached rsa-4.9-py3-none-any.whl (34 kB)
Collecting cachetools<6.0,>=2.0.0
  Using cached cachetools-5.3.1-py3-none-any.whl (9.3 kB)
Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\users\user_\appdata\roaming\python\python39\site-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow>=1.9.0->retina-face) (1.3.1)
Collecting importlib-metadata>=4.4
  Using cached importlib_metadata-6.8.0-py3-none-any.whl (22 kB)
Requirement already satisfied: zipp>=0.5 in c:\users\user_\appdata\roaming\python\python39\site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow>=1.9.0->retina-face) (3.16.2)
Collecting pyasn1<0.6.0,>=0.4.6
  Using cached pyasn1-0.5.0-py2.py3-none-any.whl (83 kB)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\user_\appdata\roaming\python\python39\site-packages (from requests[socks]->gdown>=3.10.1->retina-face) (2023.7.22)
Requirement already satisfied: idna<4,>=2.5 in c:\users\user_\appdata\roaming\python\python39\site-packages (from requests[socks]->gdown>=3.10.1->retina-face) (3.4)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\user_\appdata\roaming\python\python39\site-packages (from requests[socks]->gdown>=3.10.1->retina-face) (3.2.0)
Requirement already satisfied: oauthlib>=3.0.0 in c:\users\user_\appdata\roaming\python\python39\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard<2.14,>=2.13->tensorflow-intel==2.13.0->tensorflow>=1.9.0->retina-face) (3.2.2)
Collecting MarkupSafe>=2.1.1
  Using cached MarkupSafe-2.1.3-cp39-cp39-win_amd64.whl (17 kB)
Collecting soupsieve>1.2
  Downloading soupsieve-2.5-py3-none-any.whl (36 kB)
Collecting PySocks!=1.5.7,>=1.5.6
  Using cached PySocks-1.7.1-py3-none-any.whl (16 kB)
Requirement already satisfied: colorama in c:\users\user_\appdata\roaming\python\python39\site-packages (from tqdm->gdown>=3.10.1->retina-face) (0.4.6)
Installing collected packages: urllib3, pyasn1, rsa, pyasn1-modules, cachetools, MarkupSafe, importlib-metadata, google-auth, wheel, werkzeug, tensorboard-data-server, protobuf, numpy, markdown, grpcio, google-auth-oauthlib, wrapt, typing-extensions, termcolor, tensorflow-io-gcs-filesystem, tensorflow-estimator, tensorboard, soupsieve, PySocks, opt-einsum, libclang, keras, h5py, google-pasta, gast, flatbuffers, astunparse, tensorflow-intel, filelock, beautifulsoup4, tensorflow, opencv-python, gdown, retina-face
  Attempting uninstall: urllib3
    Found existing installation: urllib3 2.0.4
    Uninstalling urllib3-2.0.4:
      Successfully uninstalled urllib3-2.0.4
  WARNING: The scripts pyrsa-decrypt.exe, pyrsa-encrypt.exe, pyrsa-keygen.exe, pyrsa-priv2pub.exe, pyrsa-sign.exe and pyrsa-verify.exe are installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script wheel.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  Attempting uninstall: numpy
    Found existing installation: numpy 1.25.2
    Uninstalling numpy-1.25.2:
      Successfully uninstalled numpy-1.25.2
  WARNING: The script f2py.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script markdown_py.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script google-oauthlib-tool.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  Attempting uninstall: typing-extensions
    Found existing installation: typing-extensions 4.7.1
    Uninstalling typing-extensions-4.7.1:
      Successfully uninstalled typing-extensions-4.7.1
  WARNING: The script tensorboard.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts estimator_ckpt_converter.exe, import_pb_to_tensorboard.exe, saved_model_cli.exe, tensorboard.exe, tf_upgrade_v2.exe, tflite_convert.exe, toco.exe and toco_from_protos.exe are installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script gdown.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed MarkupSafe-2.1.3 PySocks-1.7.1 astunparse-1.6.3 beautifulsoup4-4.12.2 cachetools-5.3.1 filelock-3.12.4 flatbuffers-23.5.26 gast-0.4.0 gdown-4.7.1 google-auth-2.23.0 google-auth-oauthlib-1.0.0 google-pasta-0.2.0 grpcio-1.58.0 h5py-3.9.0 importlib-metadata-6.8.0 keras-2.13.1 libclang-16.0.6 markdown-3.4.4 numpy-1.24.3 opencv-python-4.8.0.76 opt-einsum-3.3.0 protobuf-4.24.3 pyasn1-0.5.0 pyasn1-modules-0.3.0 retina-face-0.0.13 rsa-4.9 soupsieve-2.5 tensorboard-2.13.0 tensorboard-data-server-0.7.1 tensorflow-2.13.0 tensorflow-estimator-2.13.0 tensorflow-intel-2.13.0 tensorflow-io-gcs-filesystem-0.31.0 termcolor-2.3.0 typing-extensions-4.5.0 urllib3-1.26.16 werkzeug-2.3.7 wheel-0.41.2 wrapt-1.15.0
WARNING: You are using pip version 21.2.4; however, version 23.2.1 is available.
You should consider upgrading via the 'C:\Program Files\Python39\python.exe -m pip install --upgrade pip' command.

Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、retina-faceが正常にインストールされたことになりますが、「WARNING」と表示されました。「WARNING」はエラーではなく警告で、インストールは行われているので、今回は一旦無視しています。

なお、今回はretina-faceのバージョン0.0.13をインストールしました。

コメント

タイトルとURLをコピーしました