我正在尝试为 iOS 应用程序实现 dlib 的面部标志检测。在 dlib 的示例中,他们这样初始化 shape_predictor:
// And we also need a shape_predictor. This is the tool that will predict face
// landmark positions given an image and face bounding box. Here we are just
// loading the model from the shape_predictor_68_face_landmarks.dat file you gave
// as a command line argument.
shape_predictor sp;
deserialize(argv[1]) >> sp;
我正在尝试在 Objective-C 中做同样的事情并且已经做到了这一点:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"shape_predictor_68_face_landmarks" ofType:@"dat"];
NSData *myData = [NSData dataWithContentsOfFile:filePath];
执行以下操作会给我一个错误“接收器类型'dlib :: shape_predictor'不是Objective-C类”
sp = [dlib::shape_predictor deserialize:myData];