Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python中的openface alignlib_Python_Dlib - Fatal编程技术网

python中的openface alignlib

python中的openface alignlib,python,dlib,Python,Dlib,我知道这对openface来说是最愚蠢的问题,但我是openface的新手,我不想弄明白这一点 align = openface.AlignDlib() 在辩论中我们需要通过什么。在openface文档中是这样写的 align = openface.AlignDlib(args.dlibFacePredictor) 它在文档中说,参数是一个数据环,它是通向dlib的路径 我不知道这意味着什么,这是我为openface编写的第一个程序。列出了一些dlib模型(官方开发人员) 在openface

我知道这对openface来说是最愚蠢的问题,但我是openface的新手,我不想弄明白这一点

align = openface.AlignDlib()
在辩论中我们需要通过什么。在openface文档中是这样写的

align = openface.AlignDlib(args.dlibFacePredictor)
它在文档中说,参数是一个数据环,它是通向dlib的路径


我不知道这意味着什么,这是我为openface编写的第一个程序。列出了一些dlib模型(官方开发人员)

在openface方面,显示了:

意思是:它是形状\u预测器\u 68\u面部\u标志。dat(以上列表的一部分)

您可以查看代码以了解更多信息,例如:


所以,我可以在我的计算机上用git克隆dlib模型,然后复制所需模型的路径,就像这个openface。AlignDlib(path)是的,但是你只需要一个,而不需要完整的列表。(还有:如果你安装了openface,它已经下载了这一个;否则它将无法工作)编辑,你可能需要解压缩它(至少openface正在使用bunzip2进行解压缩)。是的,我在openface的dlib文件夹中找到了shape_predictor_68_face_landmarks,但它是.tar格式的,我们需要解压缩它吗?我不知道(我不知道你为什么得到焦油)。我希望你需要原始的.dat(不是焦油)。但只要尝试一下。你可能会看到一个IO错误。关于这些事情:尝试一下有什么不好。根据可能需要解压缩的一般想法,潜在的错误很容易调试。a='/home/arshad/openface/models/dlib/shape\u predictor\u 68\u face\u landmarks.dat.bz2'align=openface.AlignDlib(a),这是我编写并得到错误的代码-在init self.predictor=dlib.shape_predictor(facePredictor)RuntimeError:反序列化dlib::shape_predictor时发现意外版本
mkdir -p dlib
if [ ! -f dlib/shape_predictor_68_face_landmarks.dat ]; then
  printf "\n\n====================================================\n"
  printf "Downloading dlib's public domain face landmarks model.\n"
  printf "Reference: https://github.com/davisking/dlib-models\n\n"
  printf "This will incur about 60MB of network traffic for the compressed\n"
  printf "models that will decompress to about 100MB on disk.\n"
  printf "====================================================\n\n"
  wget -nv \
       http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 \
       -O dlib/shape_predictor_68_face_landmarks.dat.bz2
  [ $? -eq 0 ] || die "+ Error in wget."
  bunzip2 dlib/shape_predictor_68_face_landmarks.dat.bz2
  [ $? -eq 0 ] || die "+ Error using bunzip2."
fi
def __init__(self, inputDir, outputDir, verbose):
    self.inputDir = inputDir
    self.dlibFacePredictor = os.path.join(
        dlibModelDir, "shape_predictor_68_face_landmarks.dat")