Skip to content

Instantly share code, notes, and snippets.

@dimpler03
Created May 25, 2018 05:18
Show Gist options
  • Save dimpler03/8d60282d5fd143856c4529e0a292e96f to your computer and use it in GitHub Desktop.
Save dimpler03/8d60282d5fd143856c4529e0a292e96f to your computer and use it in GitHub Desktop.
Prepare shape predictor
@property (assign) BOOL prepared;
@implementation MLWrapper {
dlib::shape_predictor sp;
}
- (void)prepare {
NSString *modelFileName = [[NSBundle mainBundle] pathForResource:@"shape_predictor_68_face_landmarks" ofType:@"dat"];
std::string modelFileNameCString = [modelFileName UTF8String];
dlib::deserialize(modelFileNameCString) >> sp;
self.prepared = YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment