DLib:train_shape_predictor_ex.cpp

ANU*_*NGH 1 c++ face-detection training-data dlib

我试图通过在代码中描述的helen 数据集上执行train_dlib_shape_predictor_ex.cpp来训练Dlib的形状预测器,我将测试图像放在形状预测器的当前目录中的面部文件夹中.但是,当我运行代码时,它抛出以下异常:

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.
Run Code Online (Sandbox Code Playgroud)

as no training_with_face_landmarks.xmltesting_with_face_landmarks.xmlhelen数据集中的文件可用于以下页面:link

有一个名为annotation的文件夹,其中包含一个文本文件,其中包含数据集中每个图像的194个地标点位置.如何将此文件转换为training_with_face_landmarks.xml.

gop*_*man 9

我为总共2000张图像的海伦训练图像(第1,2,3和4部分)创建了training_with_face_landmarks.xml.

下载链接:https://www.dropbox.com/s/jk98moqm8vopp5b/training_with_face_landmarks_2000.zip?dl = 0

脚步:

  1. 下载火车图像 - 第1部分,火车图像 - 第2部分,火车图像 - 第3部分和火车图像 - 第4部分来自http://www.ifp.illinois.edu/~vuongle2/helen/.(每个部分有500个图像,所以共有2000个图像)
  2. 将所有图像和training_with_face_landmarks.xml放在一个公共文件夹中(例如:文件夹名称"train").
  3. 在项目train_shape_predictor_ex.cpp中,注释掉这些部分/行

    一个.参考testing_with_face_landmarks.xml及其用法b.培训师set_oversampling_amount(100)c.培训师set_nu(0.05)d.培训师set_tree_depth(3)

  4. 将命令行参数设置为./train
  5. 运行该项目
  6. 它将生成大小约为178 MB的sp.dat(在我的笔记本电脑中大约需要2小时)
  7. 使用在face_landmark_detection_ex项目命令行EX此sp.dat文件:sp.dat Example_image.jpg
  8. 在face_landmark_detection_ex.cpp中,a.在194的循环中,调用draw_solid_circle函数b.使用save_png函数将地标输出保存为文件.

请享用 :)

关心Gopi.Ĵ

  • 更新了testing_with_face_landmarks.xml以及194点dat文件.链接:https://www.dropbox.com/sh/t5h024w0xkedq0j/AABS3GprqIvb_PwqeHOn2dxNa?dl=0 (2认同)