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

Function validate_some_object_detector_stuff

dlib/test/object_detector.cpp:48–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 typename detector_type
47 >
48 void validate_some_object_detector_stuff (
49 const image_array_type& images,
50 detector_type& detector,
51 double eps = 1e-10
52 )
53 {
54 for (unsigned long i = 0; i < images.size(); ++i)
55 {
56 std::vector<rectangle> dets = detector(images[i]);
57 std::vector<std::pair<double,rectangle> > dets2;
58
59 detector(images[i], dets2);
60
61 matrix<double,0,1> psi(detector.get_w().size());
62 matrix<double,0,1> psi2(detector.get_w().size());
63 const double thresh = detector.get_w()(detector.get_w().size()-1);
64
65 DLIB_TEST(dets.size() == dets2.size());
66 for (unsigned long j = 0; j < dets.size(); ++j)
67 {
68 DLIB_TEST(dets[j] == dets2[j].second);
69
70 const full_object_detection fdet = detector.get_scanner().get_full_object_detection(dets[j], detector.get_w());
71 psi = 0;
72 detector.get_scanner().get_feature_vector(fdet, psi);
73
74 double check_score = dot(psi,detector.get_w()) - thresh;
75 DLIB_TEST_MSG(std::abs(check_score - dets2[j].first) < eps, std::abs(check_score - dets2[j].first) << " check_score: "<< check_score);
76 }
77
78 }
79 }
80
81// ----------------------------------------------------------------------------------------
82

Callers 10

test_fhog_pyramidFunction · 0.85
test_1Function · 0.85
test_1_boxesFunction · 0.85
test_1mFunction · 0.85
test_1_fine_hogFunction · 0.85
test_1_polyFunction · 0.85
test_1m_polyFunction · 0.85
test_1_poly_nnFunction · 0.85
test_1_poly_nn_boxesFunction · 0.85
test_2Function · 0.85

Calls 3

absFunction · 0.85
dotFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected