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

Method perform_test

dlib/test/fhog.cpp:156–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154
155
156 void perform_test (
157 )
158 {
159 test_point_transforms();
160 test_on_small();
161
162 print_spinner();
163 // load the testing data
164 array2d<rgb_pixel> img;
165 array2d<unsigned char> gimg;
166 dlog << LINFO << "get_decoded_string_face_dng()";
167 istringstream sin(get_decoded_string_face_dng());
168 load_dng(img, sin);
169 assign_image(gimg, img);
170 dlog << LINFO << "get_decoded_string_fhog_feats()";
171 sin.str(get_decoded_string_fhog_feats());
172 int sbin1, sbin2, gsbin1;
173 array2d<matrix<float,31,1> > vhog1, vhog2, gvhog1;
174 deserialize(sbin1, sin);
175 deserialize(vhog1, sin);
176 deserialize(sbin2, sin);
177 deserialize(vhog2, sin);
178 dlog << LINFO << "get_decoded_string_fhog_grayscale()";
179 sin.str(get_decoded_string_fhog_grayscale());
180 deserialize(gsbin1, sin);
181 deserialize(gvhog1, sin);
182
183 /*
184 // code used to generate the saved feature data.
185 ofstream fout1("feats1.dat", ios::binary);
186 extract_fhog_features(img, vhog1, sbin1);
187 extract_fhog_features(img, vhog2, sbin2);
188 serialize(sbin1,fout1);
189 serialize(vhog1,fout1);
190 serialize(sbin2,fout1);
191 serialize(vhog2,fout1);
192 ofstream fout2("feats2.dat", ios::binary);
193 extract_fhog_features(gimg, gvhog1, gsbin1);
194 serialize(gsbin1,fout2);
195 serialize(gvhog1,fout2);
196 */
197
198 // make sure the feature extractor always outputs the same answer
199 dlog << LINFO << "1";
200 test_fhog_planar(img, sbin1, vhog1);
201 dlog << LINFO << "2";
202 test_fhog_planar(img, sbin2, vhog2);
203 dlog << LINFO << "3";
204 test_fhog_planar(gimg, gsbin1, gvhog1);
205 dlog << LINFO << "4";
206 test_fhog_interlaced(img, sbin1, vhog1);
207 dlog << LINFO << "5";
208 test_fhog_interlaced(img, sbin2, vhog2);
209 dlog << LINFO << "6";
210 test_fhog_interlaced(gimg, gsbin1, gvhog1);
211
212 }
213

Callers

nothing calls this directly

Calls 5

print_spinnerFunction · 0.85
load_dngFunction · 0.85
deserializeFunction · 0.70
assign_imageFunction · 0.50
strMethod · 0.45

Tested by

no test coverage detected