DLib : train_shape_predictor_ex.cpp
DLib : train_shape_predictor_ex.cpp
我正试图通过在helen数据集上执行train_Dlib_shape_predictor_ex.cpp来训练Dlib的形状预测器,如代码中所述,我将测试图像放在形状预测器当前目录中的人脸文件夹中。但当我运行代码时,它会抛出以下异常:
C:train_shape_predictor_exRelease>train_shape_predictor_ex test
exception thrown!
ERROR: unable to open test/training_with_face_landmarks.xml for reading.
由于helen数据集中没有可用的training_with_face_landmarks.xml
和testing_with_face_landmarks.xml
文件,请访问以下页面:链接
有一个名为annotation的文件夹,它包含一个文本文件,其中包含数据集中每个图像的194个地标点位置。如何将此文件转换为training_with_face_landmarks.xml
。
我为总共2000个图像中的helen训练图像(第1、2、3和4部分)创建了training_with_face_landmarks.xml。
下载链接:https://www.dropbox.com/s/jk98moqm8vopp5b/training_with_face_landmarks_2000.zip?dl=0
步骤:
- 下载火车图像-部分1,火车图像-第2部分,火车图像部分3&列车图像-第4部分http://www.ifp.illinois.edu/~vuongle2/海伦/。(每个部分有500个图像,因此总共有2000个图像)
- 放置所有图像&公共文件夹中的training_with_face_landmarks.xml(例如:文件夹名称"train")
-
在项目train_shape_predictor_ex.cpp中,注释掉这些部分/行
a。testing_with_face_landmarks.xml及其用法参考b.训练器集合_横向采样_装载(100)c.训练器set_nu(0.05)d.训练器set_tree_depth(3)
- 将命令行参数设置为/列车
- 运行项目
- 它将生成大小约178 MB的sp.dat(在我的笔记本电脑中大约花了2个小时)
- 在face_landmark_detection_ex项目中使用此sp.dat文件命令行Ex:sp.dat Example_image.jpg
- 在face_landmark_detection.ex.cpp中,a.在194的循环中,调用draw_solid_circle函数b.使用save_png函数将地标输出保存为文件
享受:)
问候Gopi。J
打开"training_with_face_landmarks.xml"文件并观察其结构。
现在,问问自己:
- 文件之间有什么变化?(提示:点数据)
- 什么保持不变?(提示:通用"锅炉板"顶部和尾部)
打开海伦的数据-再次问同样的问题。。。
您现在的任务是将HELEN集合中的数据解析为一个临时数据结构/变量,然后将其写入具有所有所需顶部和尾部的文件。这将是一个笨拙的和可能令人讨厌的写循环内循环内循环等,但你会做到的。
"c++i/o流"作为一个搜索字符串会让你开始。
- .cpp和.h文件中的模板专用化声明
- 为什么两个不同的未命名名称空间可以共存于一个cpp文件中
- Linux的Cpp上的计时器
- 如何运行位于boost/libs/python/example/tutorial目录中的hello.cpp和Jamfil
- 命名空间中具有.h和.cpp文件的类
- 内置函数可查看CPP中的成员变量
- 无法编译 rtmidi 测试 cmidiin.cpp 文件, 非法指令
- Cpp-Tuple使用带有变量的get
- C++-试图将函数指针推回到另一个CPP文件中的矢量时出错
- 有充分的理由在h文件中使用include保护而不是cpp文件吗
- 如何通过cpp程序运行shell脚本
- 使用2个键的cpp-stl::优先级队列排序不正确
- cpp二进制搜索问题,计算给定数组中输入元素的出现次数
- 如何在cpp文件之间切换窗口?在Qt中
- 在 .h 文件中的类中声明静态变量和在.cpp文件中声明"global"变量有什么区别
- 我需要知道编译器如何在cpp中使用析构函数
- 如何在cpp.中使用协议缓冲区存储大缓冲区/数组(char/int)
- 无法在UE4中包含BP类到CPP类
- C++:Application.cpp中抛出了未解析的外部符号(解决方案在问题的末尾,供未来的读者参考)
- 无法使用Qt Creator在Windows中构建yaml-cpp