MCPcopy Create free account
hub / github.com/davisking/dlib / perform_test

Method perform_test

dlib/test/face.cpp:51–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 }
50
51 void perform_test()
52 {
53 print_spinner();
54 dlib::array<array2d<unsigned char> > images;
55 std::vector<std::vector<full_object_detection> > objects;
56 get_test_face_landmark_dataset(images, objects);
57
58 frontal_face_detector detector = get_frontal_face_detector();
59
60 print_spinner();
61 shape_predictor_trainer trainer;
62 trainer.set_tree_depth(2);
63 trainer.set_nu(0.05);
64 //trainer.be_verbose();
65
66 shape_predictor sp = trainer.train(images, objects);
67
68 print_spinner();
69
70 // It should have been able to perfectly fit the data
71 DLIB_TEST(test_shape_predictor(sp, images, objects) == 0);
72
73 print_spinner();
74
75 // While we are here, make sure the default face detector works
76 std::vector<rectangle> dets = detector(images[0]);
77 DLIB_TEST(dets.size() == 3);
78
79
80 /*
81 // visualize the detections
82 std::vector<full_object_detection> shapes;
83 for (unsigned long j = 0; j < dets.size(); ++j)
84 {
85 full_object_detection shape = sp(images[0], dets[j]);
86 shapes.push_back(shape);
87 }
88 image_window win(images[0]);
89 win.add_overlay(render_face_detections(shapes));
90 cin.get();
91 */
92
93 }
94
95
96 // ------------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 7

print_spinnerFunction · 0.85
test_shape_predictorFunction · 0.85
set_tree_depthMethod · 0.80
set_nuMethod · 0.45
trainMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected