如何在 windows python 中安装 Openface

How to install Openface in windows python

我是 Openface 的新手。由于某些原因,我想在 windows 和 python 中安装 Openface。如果有人能指导我完成那件事,那就太好了。我在网上搜索过,但没有一篇文章谈到windows python 安装。可能我问的是一个非常简单的问题,但请帮助我解决这个问题。

我不知道 Windows 上直接使用了 OpenFace,但是如果您开始使用它,请为存储库贡献任何必要的更改。我预计只有 Linux 的功能会存在一些兼容性问题。

一个变通解决方案是使用 Docker 机器在 Windows 上预构建的 OpenFace Docker 容器。其中一些来自 OpenFace setup guide. First start a Linux Docker machine on Windows. Then pull the OpenFace docker container from here:

docker pull bamos/openface
docker run -p 9000:9000 -p 8000:8000 -t -i bamos/openface /bin/bash
cd /root/openface
./demos/compare.py images/examples/{lennon*,clapton*}
./demos/classifier.py infer models/openface/celeb-classifier.nn4.small2.v1.pkl ./images/examples/carell.jpg
./demos/web/start-servers.sh

在 windows 中安装 openface 的步骤对我有用。

  1. 从此路径下载openface- http://cmusatyalab.github.io/openface/
  2. 将文件夹 openface 粘贴到 python.exe 文件所在的路径中。
  3. 运行 命令 python openface/setup.py install

如果您使用的是 anaconda,那么以下步骤对我有用。这些步骤归功于将它们发布在 github 中的 nitish11:https://gist.github.com/ageitgey/82d0ea0fdb56dc93cb9b716e7ceb364b

  1. 从 anaconda 中打开命令行。
  2. 如果需要,安装 git (conda install -c anaconda git)
  3. git clone https://github.com/cmusatyalab/openface.git
  4. cd openface
  5. pip install -r requirements.txt
  6. (sudo) python setup.py install

sudo 可能不需要第 6 步。

希望对您有所帮助。