@@ -48,8 +48,9 @@ using anet_type = dlib::loss_metric<dlib::fc_no_bias<128, dlib::avg_pool_everyth
48
48
>>>>>>>>>>>>;
49
49
50
50
dlib::frontal_face_detector detector = dlib::get_frontal_face_detector();
51
- dlib::shape_predictor sp;
52
- anet_type net;
51
+ dlib::frontal_face_detector detector1 = dlib::get_frontal_face_detector();
52
+ dlib::shape_predictor sp, sp1;
53
+ anet_type net, net1;
53
54
54
55
// std::vector<matrix<float, 0, 1>> known_faces;
55
56
@@ -174,8 +175,12 @@ Java_com_google_android_gms_samples_vision_face_facetracker_FaceTrackerActivity_
174
175
// fclose(file3);
175
176
dlib::deserialize (" /storage/emulated/0/Download/shape_predictor_5_face_landmarks.dat" )
176
177
>> sp;
178
+ dlib::deserialize (" /storage/emulated/0/Download/shape_predictor_5_face_landmarks.dat" )
179
+ >> sp1;
177
180
dlib::deserialize (" /storage/emulated/0/Download/dlib_face_recognition_resnet_model_v1.dat" )
178
181
>> net;
182
+ dlib::deserialize (" /storage/emulated/0/Download/dlib_face_recognition_resnet_model_v1.dat" )
183
+ >> net1;
179
184
// dlib::deserialize("/storage/emulated/0/Download/faces_linear.svm") >> df;
180
185
181
186
DIR *d;
@@ -200,9 +205,6 @@ Java_com_google_android_gms_samples_vision_face_facetracker_FaceTrackerActivity_
200
205
matrix<float , 0 , 1 > face_vector;
201
206
dlib::deserialize (" /storage/emulated/0/Download/" + file) >> face_vector;
202
207
known_faces.insert ({name, face_vector});
203
-
204
- // printf("%s\t",p1);
205
- // LOGI("item %s", p1);
206
208
}
207
209
}
208
210
@@ -243,7 +245,7 @@ Java_com_google_android_gms_samples_vision_face_facetracker_FaceTrackerActivity_
243
245
244
246
img.set_size (infocolor.height , infocolor.width );
245
247
246
- // LOGI("size w=%d h=%d", infocolor.width, infocolor.height);
248
+ LOGI (" size w=%d h=%d" , infocolor.width , infocolor.height );
247
249
for (y = 0 ; y < infocolor.height ; y++) { // todo: performance
248
250
argb *line = (argb *) pixelscolor;
249
251
for (x = 0 ; x < infocolor.width ; ++x) {
@@ -254,20 +256,20 @@ Java_com_google_android_gms_samples_vision_face_facetracker_FaceTrackerActivity_
254
256
}
255
257
256
258
std::string returnValue = " Num Faces: " ;
257
- std::vector<dlib::rectangle> dets = detector (img);
259
+ std::vector<dlib::rectangle> dets = detector1 (img);
258
260
returnValue += std::to_string (dets.size ());
259
261
returnValue += " . " ;
260
262
261
- std::vector<matrix<rgb_pixel>> faces;
263
+ std::vector<matrix<rgb_pixel>> faces;
262
264
for (auto face : dets)
263
265
{
264
- auto shape = sp (img, face);
266
+ auto shape = sp1 (img, face);
265
267
matrix<rgb_pixel> face_chip;
266
268
extract_image_chip (img, get_face_chip_details (shape, 150 , 0.25 ), face_chip);
267
269
faces.push_back (move (face_chip));
268
270
}
269
271
270
- std::vector<matrix<float , 0 , 1 >> face_descriptors = net (faces);
272
+ std::vector<matrix<float , 0 , 1 >> face_descriptors = net1 (faces);
271
273
272
274
for (size_t i = 0 ; i < face_descriptors.size (); ++i)
273
275
{
0 commit comments