DLib:train_shape_predictor_ex.cpp [英] DLib : train_shape_predictor_ex.cpp
问题描述
我试图通过在 train_dlib_shape_predictor_ex.cpp 来训练Dlib的形状预测变量href =http://www.ifp.illinois.edu/~vuongle2/helen/ =nofollow> helen数据集,如代码所述,我将测试图像放置在当前目录中的face文件夹中的形状预测器。但是当我运行代码时,它抛出以下异常:
C:\train_shape_predictor_ex\Release> train_shape_predictor_ex test
抛出异常!
错误:无法打开test / training_with_face_landmarks.xml进行阅读。
为没有 training_with_face_landmarks.xml
和 testing_with_face_landmarks.xml
文件在以下页面的helen数据集中可用:链接
有一个名为注释的文件夹,其中包含一个文本文件,其中包含数据集中每个图像的194个地标点位置。如何将此文件转换为 training_with_face_landmarks.xml
。
'training_with_face_landmarks.xml'文件并观察其结构。
现在问问自己:
- 文件之间有什么变化? (提示:点数据)
- 保持不变? (提示:通用锅炉板顶部和尾部)
打开HELEN数据 - p>
您的任务现在是将HELEN集中的数据解析为临时数据结构/变量,然后将其写入具有所有必需的顶部和尾部的文件。这将是一个kludge,可能恼人的循环里面循环写循环等,但你会得到那里。
'c ++ i / o streams'搜索字符串将让您开始。
I am trying to train the shape predictor of Dlib by executing train_dlib_shape_predictor_ex.cpp on helen dataset as described in the code, I place test images in a face folder in current directory of shape predictor. But when I run the code it throws following exception:
C:\train_shape_predictor_ex\Release>train_shape_predictor_ex test
exception thrown!
ERROR: unable to open test/training_with_face_landmarks.xml for reading.
as no training_with_face_landmarks.xml
and testing_with_face_landmarks.xml
files are available in helen dataset on the following page : link
There is a folder named annotation which contains one text file containing the 194 landmark points location for each and every image in the dataset. How to convert this file into training_with_face_landmarks.xml
.
Open up the 'training_with_face_landmarks.xml' file and observe its structure.
Now, ask yourself:
- What changes between files? (hint: the point data)
- What stays the same? (hint: generic 'boiler plate' top and tail)
Open up the HELEN data - ask the same again...
Your task now is to parse the data from the HELEN set into a temporary data-structure/variable and then write it to file with all the required top and tail. It'll be a kludge and likely annoying to write with loops inside loops inside loops etc. but you'll get there.
'c++ i/o streams' as a search string will get you started.
这篇关于DLib:train_shape_predictor_ex.cpp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!